eric / metriks

An experimental library to instrument ruby
MIT License
478 stars 51 forks source link

add support for derivative metrics #22

Closed hollow closed 4 years ago

hollow commented 12 years ago

A derivative metric is like a meter but accepts an absolute counter as input. This is useful for metrics like bytes sent over the network or cpu cycles which are generally monotonically increasing counters and therefore need to be derived from the previous sample to get a useful rate/s value.

eric commented 11 years ago

I think we should make a derivative metric not inherit from Meter.

The things to consider are:

  1. How often is the derived metric going to be updated?
  2. How often is the reporter going to report on the metric?
  3. What should happen if the derived metric hasn't been updated since the last report?
  4. What should happen if the derived metric has been updated more than once since the last report?

With the Meter we have, we expect that we will be incrementing it as things happen, but with this derived metric, we are (I would guess) expecting to update it on a regular interval, so it has a lot of different implications.

hollow commented 11 years ago

In my case:

  1. every second
  2. just like for any other metric?

since i collect these metrics every second, i don't really care about the other two, but i would suggest something like:

  1. & 4. nothing or something invalid (like -∞)

probably do it similar to RRDtool, people are already familiar how DERIVE works with RRAs