pmx icon indicating copy to clipboard operation
pmx copied to clipboard

Histogram metric does not keep a moving average

Open ATGardner opened this issue 8 years ago • 1 comments

When checking out the Histogram custom metric, I see that the default value just uses a mean value over all the values I send. There is no bias towards the last 5 minutes. Digging through the code I see it has an _ema value, which might be what I need (I'm not sure about the alpha selection), but I couldn't find any way to send that value to keymetrics. How can I get a histogram that is biased towards the last 5 minutes?

ATGardner avatar Jul 05 '17 08:07 ATGardner

Hey, thanks for the good catch.

Here are the avalaible options for the measurement values:

Options

measurement option can be:

  • min: The lowest observed value.
  • max: The highest observed value.
  • sum: The sum of all observed values.
  • variance: The variance of all observed values.
  • mean: The average of all observed values.
  • stddev: The stddev of all observed values.
  • count: The number of observed values.
  • median: 50% of all values in the resevoir are at or below this value.
  • p75: See median, 75% percentile.
  • p95: See median, 95% percentile.
  • p99: See median, 99% percentile.
  • p999: See median, 99.9% percentile.

The ema option was used internally and cannot be called simply from pmx on this version, I will push a new version where you can call it.

In the meanwhile if this is relevant to your use case, you can use the median which will hit the biaised reservoir.

alavit-d avatar Jul 05 '17 14:07 alavit-d