[rrd-users] Question about time stamp, etc with GAUGE DST
Chris Nighswonger
cnighswonger at foundations.edu
Fri Nov 9 17:38:34 CET 2012
On Thu, Nov 8, 2012 at 10:17 PM, Ryan Kubica <kubicaryan at yahoo.com> wrote:
>
> RRD is interpolating the value since you aren't inserting on the
> step-second (1352425140 1352425200 etc...)
>
> Since your insert is part way into the step interval of 1352425140 rrd is
> splitting the value between the two step intervals.
>
>
That's sort of what I thought might be happening.
> If you don't want interpolation the easiest way to avoid it is to
> subtract the modulus of time of 60 from time: time - (time % 60) ... gives
> you the step interval time to insert with.
>
> ps: you should also ensure that your loop code isn't doing a sleep 60,
> since you will drift in time with logic like that (that 3 seconds you
> gained between 121 and 184) ... use a wait counter that's based on:
> sync_time + 60 and wait until sync_time on each loop, etc.
>
>
So now I'm doing such as this:
sync_time = time - (time % 60) ## set sync_time to zero secs
while (1) {
if (time == sync_time + 60) { ## has a minute elapsed
sync_time = time - (time % 60) ## set current sync_time to zero
secs; use this as the RRD insert time
#### grab data and record it ####
}
}
So far the calculated time field is dead on the RRD time field.
Thanks!
Kind Regards,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20121109/07173612/attachment.htm
More information about the rrd-users
mailing list