ratecounter icon indicating copy to clipboard operation
ratecounter copied to clipboard

A Thread-Safe RateCounter implementation in Golang

Results 5 ratecounter issues
Sort by recently updated
recently updated
newest added

I notice that there've been additions to the API since v0.2.0 release; are there plans to release 0.3.0 or something beyond 0.2.0?

#23 There is a `Counter.Reset()` method, but not a `RateCounter.Reset()` method. Making the `RateCounter` atomically resettable adds some performance overhead, so I've added a new `ResettableRateCounter`, which adds this overhead...

Is there a way to reset the counter and/or ratecounter back to initial conditions?

On Fedora Rawhide with Go 1.16 beta, the test TestRateCounterHighResolution fails: ``` Testing in: /builddir/build/BUILD/ratecounter-a05fe2ccb7bd521822002ddbd47903ac1ed1eb63/_build/src PATH: /builddir/build/BUILD/ratecounter-a05fe2ccb7bd521822002ddbd47903ac1ed1eb63/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin GOPATH: /builddir/build/BUILD/ratecounter-a05fe2ccb7bd521822002ddbd47903ac1ed1eb63/_build:/usr/share/gocode GO111MODULE: off command: go test -buildmode pie -compiler gc -ldflags "...

The current implementation of the rate counter assumes that time.NewTicker will tick (write to the channel) at every (interval / resolution). However, when the application and/or CPU has a heavy...