[rrd-users] rrdtool getting incorrect values after update

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Thu Mar 14 01:31:24 CET 2013


In addition to Steve's answer, I have something more to add:

>Now my script updates exactly every 300
> seconds after it has started running, so i'm sure the timing is exactly 
> 300
> seconds apart.

I am sure that the timing will NOT be exactly 300 seconds apart. That means 
your rates will also be slightly off. The difference will be less obvious 
than what Steve already told you, but it will be there.

If you want exactly 300 seconds apart, even if not on a normalized RRD 
boundary, you will have to use explicit timestamps.

HTH
Alex


----- Original Message ----- 
From: "spalxy" <spalxy at gmail.com>
To: <rrd-users at lists.oetiker.ch>
Sent: Wednesday, March 13, 2013 2:27 PM
Subject: [rrd-users] rrdtool getting incorrect values after update


> Hi guys, i have been searching over the docs a lot the last few day, hence 
> i
> am very new to RRD and i've been trying to get something going. I am 
> trying
> to migrate from an old software of mine, which uses RRD to a new software,
> which doesnt. So far i've figured out how to dump the rrd tables and what
> does rrd to when saving the values, however i've had issues getting the 
> same
> values that get stored inside rrd. Here is a quick example i made, hope 
> you
> can give me a hand.
>
> I made a simple php file, which runs every 300 seconds and updates a RRD
> database. The cycle checks if the .rrd file exists and if it doest, then 
> it
> creates it:
> Here is my create statement (the one my old software uses):
> rrdtool create test.rrd DS:cpu:DERIVE:800:0:112500 RRA:AVERAGE:0.5:1:600
>
> And immediately after the file is created, the script runs an update
> statement:
> rrdtool update test.rrd N:5848
>
> (the value above is an example). Now my script updates exactly every 300
> seconds after it has started running, so i'm sure the timing is exactly 
> 300
> seconds apart. Now, here are the values i have tested with: (timestamp -
> value)
> 1363128441 - 5791
> 1363128741 - 6665
> 1363129041 - 7482
>
> And here are the results rrd has stored (this is from a xml dump):
> <row><v> 2.9050692504e+00 </v></row>
> <row><v> 2.8128932327e+00 </v></row>
>
> Now as per my understanding, the first value should be the result from:
> (6665 - 5791)/300 = 2,913333333333333 ... which doesnt match the first
> value. The same issue applies to the second value and any other value i 
> have
> tested. What am i doing wrong ?
> Thank you.



More information about the rrd-users mailing list