[rrd-users] RRA AVERAGE:0.5:1 undesirable result
kssgill
kssgill at hotmail.com
Mon Oct 12 23:48:20 CEST 2009
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
Attached is the perl script I use to update the rrd file.
#!/opt/perl2exe/perl5/bin/perl
my $i=2;
while ( true ) {
print "updating: $i\n";
my $rrdUpd = `rrdupdate testfile.rrd -t await N:$i`; chomp($rrdUpd);
$i=$i+2;
sleep(20);
}
I let it run for a few minutes while it updates the numbers:
updating: 2
updating: 4
updating: 6
updating: 8
updating: 10
updating: 12
updating: 14
updating: 16
updating: 18
updating: 20
updating: 22
updating: 24
updating: 26
I then did a dump of the rrd in a txt readable format as :
rrdtool dump testfile.rrd > testfile1.dump
I then look for my updates.
grep -v 'NaN' testfile2.dump
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
<step> 20 </step> <!-- Seconds -->
<lastupdate> 1255382402 </lastupdate> <!-- 2009-10-12 17:20:02 EDT
-->
<ds>
<name> await </name>
<type> GAUGE </type>
<minimal_heartbeat> 40 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+07 </max>
<!-- PDP Status -->
<last_ds> 8 </last_ds>
<value> 2.3504256000e+01 </value>
<unknown_sec> 0 </unknown_sec>
</ds>
<!-- Round Robin Archives --> <rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 20 seconds -->
<params>
<xff> 5.0000000000e-01 </xff>
</params>
<cdp_prep>
<ds>
<primary_value> 7.7067147000e+00 </primary_value>
<secondary_value> 0.0000000000e+00
</secondary_value>
<unknown_datapoints> 0 </unknown_datapoints>
</ds>
</cdp_prep>
<database>
<!-- 2009-10-12 17:19:00 EDT / 1255382340 -->
<row><v> 2.0000000000e+00 </v></row>
<!-- 2009-10-12 17:19:20 EDT / 1255382360 -->
<row><v> 3.7085260000e+00 </v></row>
<!-- 2009-10-12 17:19:40 EDT / 1255382380 -->
<row><v> 5.7077767000e+00 </v></row>
<!-- 2009-10-12 17:20:00 EDT / 1255382400 -->
<row><v> 7.7067147000e+00 </v></row>
</database>
</rra>
</rrd>
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.
rrdtool version is:
rrdtool -v
RRDtool 1.2.27 Copyright 1997-2008 by Tobias Oetiker <tobi at oetiker.ch>
Compiled Oct 24 2008 03:40:57
--
View this message in context: http://n2.nabble.com/RRA-AVERAGE-0-5-1-undesirable-result-tp3810921p3810921.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.
More information about the rrd-users
mailing list