metrics icon indicating copy to clipboard operation
metrics copied to clipboard

Is there any way to reset the Metrics Counter/Timer once its reported to Graphite/console

Open priyavivek1 opened this issue 8 years ago • 2 comments

priyavivek1 avatar Apr 10 '16 01:04 priyavivek1

I assume you want to reset them because it is Graphite that does aggregation over time so you are only interested in measuring the number of new occurrences / ... since the latest report, right?

I have the same need. I fixed it by resetting counters manually (I have my own, modified InfluxReporter with a metricReportedHook that I can use to reset a metric). I believe it is not necessary to update meters as they do and should report the rate in the past 1/5/15 min and are updating themselves (decaying the value) provided you remember to call .tick every 5s (see #37). Though I need to think more about this :).

It would be nice if metrics had support for this built in. I am sure the author would welcome a PR :).

holyjak avatar Dec 21 '16 07:12 holyjak

👍 sounds like a good idea, maybe a top level option in ScheduledReporter to control this would be nice.

tolbertam avatar Dec 27 '16 21:12 tolbertam