rcrowley / go-metrics

Go port of Coda Hale's Metrics library
Other
3.43k stars 493 forks source link

timer percentiles get stuck if update isn't called #215

Open newhook opened 6 years ago

newhook commented 6 years ago

I'm using a timer to record request latency percentiles. The problem is if there are no requests (meaning no calls to Update) the percentiles get "stuck" (meaning they latch on the last set of percentiles). Looking at the code this is because ExpDecaySample.update is the only thing that updates the samples (there is nothing that "ticks" the samples).

Is this deliberate?

I believe the java impl doesn't have this issue because the dataset is rescaled when fetched.

https://github.com/dropwizard/metrics/blob/4.0-development/metrics-core/src/main/java/com/codahale/metrics/ExponentiallyDecayingReservoir.java

ashrayjain commented 5 years ago

@mihasya

Are there any plans/interest for addressing this? Happy to contribute a PR if so