go-metrics
go-metrics copied to clipboard
Add Clear to Meter and Timer
I needed Clear() on both Meter and Timer to reset these after a unit test. Counter, Histogram, Sample already have Clear so I added equivalent methods.
+1 Can we get this merged?
+1 as this should resolve #120
(starting to try and catch up on the backlog)
I am reluctant to accept a change which extends an interface, then immediately proceeds to add implementations which panic
to half of the implementations.
Could the method just be added to the implementation you're testing and left out of the interface?
@FZambia I'll comment in the ticket itself, but I wanted to make it clear here too: nothing you've described in #120 sounds like a bug to me.
Bump, @henning77 can you weigh in on the question from July 4th? Thanks!
@mihasya Clear() panics when called on the snapshot. Which is reasonable and in line with the other Clear() implementations, e.g. in https://github.com/rcrowley/go-metrics/blob/master/histogram.go
+1 Can we get this merged? Seems to be reasonable.