Open michaelnatkin opened 7 years ago
Fix is to add @cache = {}
to CounterCache#flushTo
@bobzoller see above
... or maybe it should have remained as a gauge?
Yes, I think the correct thing is it should have stayed a gauge. Although it sounds right, increment shouldn't use counters, because counters are meant only for tracking the derivative of a monotonically increasing value (which you've done) and can't be used with server-side aggregation (which makes them useless for the normal increment case).
https://www.librato.com/docs/kb/faq/glossary/whats_a_counter/ https://www.librato.com/docs/kb/faq/app_questions/count_events/ https://github.com/librato/librato-metrics/issues/105
we went around on this back in #27 ... my intention is to treat librato-rack as the best practice, which is why increment
was changed to use counters. at the time, I also bought into the case that was made for not deleting/resetting counters. FWIW, despite a somewhat painful migration, this has worked fine for our use cases.
I added a little console.log and reduced the flush period just to demonstrate the problem: