I use codahale metrics (now dropwizard metrics) to track several events happening on my system. I use counters metrics to track the amount of time that an event has occurred.
I checked the values ββprinted by the reporter for my counters and it looks like the value continues to increase (and never decreases). This seems logical, because I always use the metrics.inc () function whenever my "event" occurs.
What I really want is to get count of my 'event' happening between two reporting times , for this I need to reset my counter every time I report my indicators, but I could not find any option in the counter metrics to do this. Is there a way or common practice that codahale users follow to create such metrics?
Current behavior (transmission time 10 seconds):
00:00:00 0 00:00:10 2 // event happened twice 00:00:20 2 // event did not occur 00:00:30 5 // event occured three times`
Expected Performance:
00:00:00 0 00:00:10 2 00:00:20 0 00:00:30 3
source share