[rrd-developers] Re: RRD DERIVE Data type, invalid inputs.

Alex van den Bogaerdt alex at ergens.op.het.net
Thu Nov 25 16:41:08 MET 2004

On Thu, Nov 25, 2004 at 09:52:56AM -0500, Greg Prosser wrote:
> Hi Guys,
> I'm not sure what combination of environments contributed to this, but
> I've discovered what I believe is a bug in the handling of rrdtool's
> DERIVE data source, specifically in the handling of invalid data checking
> during updates.

Can counters, or rates, become negative ?
Derive is essentially a COUNTER type.

A small test script may show what happens:

>---- cut here ----<


rrdtool create test.rrd --start 1101395700 DS:rate:$dstype:100000:U:U RRA:AVERAGE:0.5:1:20

rrdtool update test.rrd 1101396000:-200
rrdtool update test.rrd 1101396300:40
rrdtool update test.rrd 1101396600:30
rrdtool update test.rrd 1101396900:35
rrdtool update test.rrd 1101397200:+20
rrdtool update test.rrd 1101397500:40

rrdtool fetch test.rrd --start 1101395700 --end 1101397500 AVERAGE
>---- cut here ----<


Currently it seems no problem to have a negative rate but it is a problem
to have a negative counter value.

Interestingly the current behaviour is to not complain when the negative
number is following an unknown.  The negative number does not seem to be
stored, I'd expect (-200 to 40)/300 to become 0.8 in stead of NaN:

(edited my script to use DERIVE)
    $ sh do_test
    ERROR: not a simple integer: '+20'
    timestamp    rate

    1101395700:  nan
    1101396000:  nan
    1101396300:  nan
    1101396600:  -3.3333333333e-02
    1101396900:  1.6666666667e-02
    1101397200:  8.3333333333e-03
    1101397500:  8.3333333333e-03

RRDtool didn't complain about the first update (1101396000) and
also did not compute 0.8 for interval 1101396000 to 1101396300.

I ask you to respect any "Reply-To" and "Mail-Follow-Up" headers.  If
you reply to me off-list, you'd better tell me you're doing so.  If
you don't, and if I reply to the list, that's your problem, not mine.

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

More information about the rrd-developers mailing list