influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Derivative should handle counter wrapping

Open pauldix opened this issue 12 years ago • 11 comments

Derivatives are used to get rates when feeding in counter values. It's common to have these values either wrap to 0 or to get reset to 0 when a host restarts. We should handle this gracefully and compute a rate based on the wrap.

pauldix avatar May 16 '14 14:05 pauldix

In the case of a reset (much more common than a wrap with today's 64-bit counters), it's impossible to calculate a correct value, and assuming 0 also has its problems. In our investigation it's better to drop values that can be determined to be caused by reset.

madelynnblue avatar Jun 05 '14 17:06 madelynnblue

+1 for drop value (or average the adjacent points). Filling in the counter wrap means you'll need the user to feed in the max expected value or you'll be providing impossible values to the client (who will then need to drop the data).

ragzilla avatar Jul 06 '14 23:07 ragzilla

Drop on a reset is probably reasonable, since the hitting a 64 bit counter wrap is going to be pretty rare nowadays. If you want to support clients potentially using 16 or 32 bit counters, then I'd suggest adjusting derivative to optionally accept a max and reset value OpenTSDB's rate options deal with this nicely (http://opentsdb.net/docs/build/html/api_http/query/index.html). They also have an explicit boolean to state that something is a counter (since for other stuff, a plain rate/derivative that can go negative is completely reasonable).

tcolgate avatar Aug 27 '14 07:08 tcolgate

+1. I don't have much input in the way of how to handle counter resets, but any handling at all to avoid the big valleys in derivative searches would be awesome.

cboggs avatar Sep 17 '14 16:09 cboggs

+1 It would be great to have the equivalent of Graphite's nonNegativeDerivative()

mgravlin avatar Sep 23 '14 16:09 mgravlin

:+1:

nikicat avatar Nov 18 '14 21:11 nikicat

:+1:

ciceroverneck avatar Dec 16 '14 11:12 ciceroverneck

:+1:

ghost avatar Jan 10 '15 13:01 ghost

+1

mkmik avatar Jan 19 '15 23:01 mkmik

+1

carl-amplidata avatar Feb 03 '15 10:02 carl-amplidata

Closing this out as it will be resolved in the 0.9.0 release. We're using #1477 to track the implementation of this feature.

pauldix avatar Feb 03 '15 15:02 pauldix