rcrowley / go-metrics

Go port of Coda Hale's Metrics library
Other
3.46k stars 494 forks source link

ExpDecaySample does not handle time weight correctly #150

Open i0exception opened 8 years ago

i0exception commented 8 years ago

The Snapshot returned by ExpSampleDecay.Snapshot() assigns equal weight to all values. As a result, percentiles are dominated by old values in cases where we have a bunch of updates in a short timespan followed by infrequent updates. I think we need something similar to https://github.com/dropwizard/metrics/blob/master/metrics-core/src/main/java/io/dropwizard/metrics/WeightedSnapshot.java.

Thoughts?