[rrd-users] Re: Perl RRD graphing rounding error

James Kingston james.kingston at gmail.com
Sat Nov 6 08:47:21 MET 2004


On Sat, 6 Nov 2004 00:23:22 +0100 (MET), Tobias Oetiker 
> 
> the problem is that the way you are drawing, your set does contain
> nan ... you are pulling data from the rrd which has not been put in
> yet hence it is nan ...
> 
> cheers
> topbi
> 

I've done some more digging and still can't quite make out what is
happening.  I've compiled in the debugging output and have added a
couple of debugging statements of my own.  For the range that I've
been looking at, it appears as though two nans did make their way as
input into the CDEF, even though the fetch function finds defined data.

Here are 3 of the samples from the dump, the middle one will later
prove problematic:
<!-- 2004-10-22 22:36:00 PDT / 1098509760 --> 
<row><v> 8.9701541667e+01 </v><v> 1.0000000000e+02 </v></row>
<!-- 2004-10-22 23:00:00 PDT / 1098511200 --> 
<row><v> 9.0299125000e+01 </v><v> 1.0000000000e+02 </v></row>
<!-- 2004-10-22 23:24:00 PDT / 1098512640 --> 
<row><v> 8.9813666667e+01 </v><v> 1.0000000000e+02 </v></row>

>From a fetch call:
1098509760:  8.9701541667e+01  1.0000000000e+02
1098511200:  9.0299125000e+01  1.0000000000e+02
1098512640:  8.9813666667e+01  1.0000000000e+02

Here they are in rrd_fetch_fn():
post fetch 1182 --      89.70     100.00
post fetch 1183 --      90.30     100.00
post fetch 1184 --      89.81     100.00

Then I added a couple of debugging statements into data_calc...
I've added this after line 1006 of rrd_graph.c:
printf ("myPRE: %f\t", now, stack[stptr]); 

And this after line 1300:
printf ("myPOST : %d -> %f\n", now, stack[0]);

These are for ds0:
myPRE: 89.701542  myPOST : 1098506880 -> 89.701542
myPRE: nan        myPOST : 1098511200 -> nan
myPRE: 89.760514  myPOST : 1098515520 -> 89.760514

And I got these are for ds1:
myPRE: 100.000000 myPRE: 100.000000 myPOST : 1098506880 -> 100.000000
myPRE: nan        myPRE: nan        myPOST : 1098511200 -> 0.000000
myPRE: 100.000000 myPRE: 100.000000 myPOST : 1098515520 -> 100.000000

So somewhere in between data_fetch and data_calc my sample is losing
its definition.  I think it's time to crank out the debugger.  If I
find anything of interest I'll report back.  Thanks to those who have
responded.

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list