Histogram metric does not keep a moving average
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?
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.