Rename rate.Add to rate.Accumulate.
This commit is contained in:
@@ -33,7 +33,7 @@ func (e *Estimator) swap(now time.Time) {
|
||||
e.time = now
|
||||
}
|
||||
|
||||
func (e *Estimator) Add(count uint32) {
|
||||
func (e *Estimator) Accumulate(count uint32) {
|
||||
atomic.AddUint32(&e.count, count)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ func TestEstimator(t *testing.T) {
|
||||
e := New(time.Second)
|
||||
|
||||
e.estimate(now)
|
||||
e.Add(42)
|
||||
e.Add(128)
|
||||
e.Accumulate(42)
|
||||
e.Accumulate(128)
|
||||
e.estimate(now.Add(time.Second))
|
||||
rate := e.estimate(now.Add(time.Second + time.Millisecond))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user