[rrd-users] Discrepancy between RRD Average and hand-rolled Average

Ruttenberg, Tanya Tanya.Ruttenberg at ssa.gov
Wed Jun 18 14:10:51 CEST 2008


I have a script that fetches RRD data for the last 5 days.  I take the
average of that data (it happens to be inbound utilization) in the usual
way: sum the data and divide by the number of pieces of data.  The
result I get is 95097.03.

I have another script that uses rrdtool graph and VDEF and PRINT to get
the average of the data from **the same rrdfile**:

my ($result, $b, $c) = RRDs::graph("/dev/null", "--start", "$starttime",
   "--end", "$endtime", "DEF:ds0=${file}:$inDS:AVERAGE",
"VDEF:ds1=ds0,AVERAGE", "PRINT:ds1:%20lf"
);
my $inAve1 = $$result[0];
$inAve1 =~ s/\s//g;

The result I get from this is quite different than the other one:
119465.02

Any idea why there might be a discrepancy? I use the same start (now - 5
days) and end time (now) for each

Tanya Ruttenberg
SMC/OND Administrator for DNE
410-965-9605
SMC Email & Home Page: #SMC Admin http://smc.ba.ssa.gov 
OND Email & Home Page: #OND Admin
http://ssahost.ba.ssa.gov/ONDwebinterface 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20080618/d34f90bd/attachment.html 


More information about the rrd-users mailing list