Incorrect Wrap in nonNegativeDerivative

Bug #660861 reported by Tony Bunce
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Graphite
Fix Released
Undecided
Unassigned

Bug Description

I think the wrapping/rollover calculation used in nonNegativeDerivative is incorrect.

This is the current formula that is being used:
newValues.append( prev + (maxValue - val) )

I think the correct formula is:
 newValues.append( val+ (maxValue - prev) + 1 )
or
 newValues.append( maxValue + (prev- val) + 1 )

Look at "Counter Wraps" here:
http://www.mrtg.org/rrdtool/tut/rrdtutorial.en.html

For example on a 32 bit snmp counter:
MAX: 4294967295
Reading 1: 429496700
Reading 2: 100
Delta = -429496600
graphite value = ( 429496700 + (4294967295 - 100) ) = 4724463895
RRD Value = 429496700 + (4294967295 - 100) + 1 = 3865470696

I think 3865470696 is the correct value

chrismd (chrismd)
Changed in graphite:
status: New → Confirmed
Revision history for this message
chrismd (chrismd) wrote :

You're absolutely right, committing this fix to trunk.

Changed in graphite:
status: Confirmed → Fix Committed
chrismd (chrismd)
Changed in graphite:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.