Derivative should handle counter wrapping
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.
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.
+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).
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).
+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.
+1 It would be great to have the equivalent of Graphite's nonNegativeDerivative()
:+1:
:+1:
:+1:
+1
+1
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.