Open vlpoliakov28 opened 3 years ago
I'm sorry, I don't understand your question.
Hi! When used function Update, what date wrote in rrd file? In field last_update. How write in field last_update my own date?
The Update
method takes a time as its first parameter. See the code bellow:
u := NewUpdater(dbfile)
for i := 0; i < 10; i++ {
time.Sleep(step * time.Second)
err := u.Update(time.Now(), i, 1.5*float64(i))
if err != nil {
t.Fatal(err)
}
}
You can replace time.Now()
with arbitrary date but be careful because RRD library checks it against the previous data/timestamp written and can drop data with inconsistent timestamp.
Big thanks! I will try it!
hi! By a call of the function Update value date in field _lastupdate in rrd file the current datetime value setting. why?