[rrd-users] RRA AVERAGE:0.5:1 undesirable result

Marc Powell marc at ena.com
Tue Oct 13 00:10:48 CEST 2009

On Oct 12, 2009, at 4:48 PM, kssgill wrote:

> Hi,  I've setup a test RRA as shown below and create a perl script  
> to popuate
> it with test data. I'm see rounding off of data which is not what I  
> was
> expecting.
> This is how I created an rrd file:
> rrdtool create testfile.rrd  -s 20 DS:await:GAUGE:40:0:10000000
> RRA:AVERAGE:0.5:1:1598400

I'm not an rrdtool expert but... You don't specify a start time so  
you're telling rrdtool to expect updates at exactly 20 second  
intervals from [the time this file is created -10 seconds]...

> my $rrdUpd = `rrdupdate testfile.rrd -t await N:$i`; chomp($rrdUpd);

This uses the current timestamp (N), which may or may not be exactly a  
20 second interval from the above start time...

> And I'm surprised to see that instead of see 2,4,6,8. The numbers are
> 2,3.7,5.7,7.7
> 2.0000000000e+00
> 3.7085260000e+00
> 5.7077767000e+00
> 7.7067147000e+00
> Not able to understand how I lost percision on the number.  From  
> reading
> online Average:0.5:1 should be the number it self.

Only if you input data on the exact timestamps that correspond to the  
buckets (steps from start) you've created in the RRD. In your case,  
your insert timestamp is a little bit off from the bucket and RRDtool  
is adjusting the value to fit in the bucket based on its rate (all  
values to rrdtool are rates).


More information about the rrd-users mailing list