Rename rate.Add to rate.Accumulate.

This commit is contained in:
Juliusz Chroboczek
2020-05-31 23:47:12 +02:00
parent c4284a45c5
commit 70dee15f5c
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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)
}
+2 -2
View File
@@ -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))