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

kssgill kssgill at hotmail.com
Tue Oct 13 02:11:02 CEST 2009



Thanks Marc for the feedback.

 

Rewrote the program to rrdupdate with time stamp and results appear correct now.

 

                        <!-- 2009-10-12 20:03:40 EDT / 1255392220 --> <row><v> 4.0000000000e+00 </v></row>
                        <!-- 2009-10-12 20:04:00 EDT / 1255392240 --> <row><v> 6.0000000000e+00 </v></row>
                        <!-- 2009-10-12 20:04:20 EDT / 1255392260 --> <row><v> 8.0000000000e+00 </v></row>
                        <!-- 2009-10-12 20:04:40 EDT / 1255392280 --> <row><v> 1.0000000000e+01 </v></row>
                        <!-- 2009-10-12 20:05:00 EDT / 1255392300 --> <row><v> 1.2000000000e+01 </v></row>
                        <!-- 2009-10-12 20:05:20 EDT / 1255392320 --> <row><v> 1.4000000000e+01 </v></row>
                        <!-- 2009-10-12 20:05:40 EDT / 1255392340 --> <row><v> 1.6000000000e+01 </v></row>
                        <!-- 2009-10-12 20:06:00 EDT / 1255392360 --> <row><v> 1.8000000000e+01 </v></row>
                        <!-- 2009-10-12 20:06:20 EDT / 1255392380 --> <row><v> 2.0000000000e+01 </v></row>
                        <!-- 2009-10-12 20:06:40 EDT / 1255392400 --> <row><v> 2.2000000000e+01 </v></row>
                        <!-- 2009-10-12 20:07:00 EDT / 1255392420 --> <row><v> 2.4000000000e+01 </v></row>
                        <!-- 2009-10-12 20:07:20 EDT / 1255392440 --> <row><v> 2.6000000000e+01 </v></row>
                        <!-- 2009-10-12 20:07:40 EDT / 1255392460 --> <row><v> 2.8000000000e+01 </v></row>
                        <!-- 2009-10-12 20:08:00 EDT / 1255392480 --> <row><v> 3.0000000000e+01 </v></row>
                        <!-- 2009-10-12 20:08:20 EDT / 1255392500 --> <row><v> 3.2000000000e+01 </v></row>
                        <!-- 2009-10-12 20:08:40 EDT / 1255392520 --> <row><v> 3.4000000000e+01 </v></row>
                        <!-- 2009-10-12 20:09:00 EDT / 1255392540 --> <row><v> 3.6000000000e+01 </v></row>
                        <!-- 2009-10-12 20:09:20 EDT / 1255392560 --> <row><v> 3.8000000000e+01 </v></row>
                        <!-- 2009-10-12 20:09:40 EDT / 1255392580 --> <row><v> 4.0000000000e+01 </v></row>
                        <!-- 2009-10-12 20:10:00 EDT / 1255392600 --> <row><v> 4.2000000000e+01 </v></row>
                        <!-- 2009-10-12 20:10:20 EDT / 1255392620 --> <row><v> 4.4000000000e+01 </v></row>
                        <!-- 2009-10-12 20:10:40 EDT / 1255392640 --> <row><v> 4.6000000000e+01 </v></row>
                        <!-- 2009-10-12 20:11:00 EDT / 1255392660 --> <row><v> 4.8000000000e+01 </v></row>
                        <!-- 2009-10-12 20:11:20 EDT / 1255392680 --> <row><v> 5.0000000000e+01 </v></row>
                        <!-- 2009-10-12 20:11:40 EDT / 1255392700 --> <row><v> 5.2000000000e+01 </v></row>
                        <!-- 2009-10-12 20:12:00 EDT / 1255392720 --> <row><v> 5.4000000000e+01 </v></row>


Very interesting ... I was relying on sleep(20) for the updates to be 20sec apart which caused the average function to adjust the value.

 

 

-Kanwar
 


Date: Mon, 12 Oct 2009 15:11:14 -0700
From: ml-user+90412-1259777342 at n2.nabble.com
To: kssgill at hotmail.com
Subject: Re: [rrd-users] RRA AVERAGE:0.5:1 undesirable result


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). 

-- 
Marc 

_______________________________________________ 
rrd-users mailing list 
[hidden email] 
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users





View message @ http://n2.nabble.com/RRA-AVERAGE-0-5-1-undesirable-result-tp3810921p3811085.html 
To unsubscribe from RRA AVERAGE:0.5:1 undesirable result, click here. 
 		 	   		  
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/
-- 
View this message in context: http://n2.nabble.com/RRA-AVERAGE-0-5-1-undesirable-result-tp3810921p3811597.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.



More information about the rrd-users mailing list