<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Discrepancy between RRD Average and hand-rolled Average</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Courier">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.</FONT></P>
<P><FONT SIZE=2 FACE="Courier">I have another script that uses rrdtool graph and VDEF and PRINT to get the average of the data from **the same rrdfile**:</FONT></P>
<P><FONT SIZE=2 FACE="Courier">my ($result, $b, $c) = RRDs::graph("/dev/null", "--start", "$starttime",</FONT>
<BR><FONT SIZE=2 FACE="Courier"> "--end", "$endtime", "DEF:ds0=${file}:$inDS:AVERAGE", "VDEF:ds1=ds0,AVERAGE", "PRINT:ds1:%20lf"</FONT>
<BR><FONT SIZE=2 FACE="Courier">);</FONT>
<BR><FONT SIZE=2 FACE="Courier">my $inAve1 = $$result[0];</FONT>
<BR><FONT SIZE=2 FACE="Courier">$inAve1 =~ s/\s//g;</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier">The result I get from this is quite different than the other one: 119465.02</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier">Any idea why there might be a discrepancy? I use the same start (now - 5 days) and end time (now) for each</FONT>
</P>
<P><FONT SIZE=2 FACE="Courier">Tanya Ruttenberg</FONT>
<BR><FONT SIZE=2 FACE="Courier">SMC/OND Administrator for DNE</FONT>
<BR><FONT SIZE=2 FACE="Courier">410-965-9605</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Courier">SMC Email & Home Page: #SMC Admin</FONT> <A HREF="http://smc.ba.ssa.gov"><U></U><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier">http://smc.ba.ssa.gov</FONT></U></A><FONT COLOR="#0000FF" SIZE=2 FACE="Courier"> </FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Courier">OND Email & Home Page: #OND Admin</FONT> <A HREF="http://ssahost.ba.ssa.gov/ONDwebinterface"><U></U><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier">http://ssahost.ba.ssa.gov/ONDwebinterface</FONT></U></A><FONT COLOR="#0000FF" SIZE=2 FACE="Courier"> </FONT>
</P>
<BR>
</BODY>
</HTML>