mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-12-28 03:47:57 +08:00
5ce6bbf076
glide has its own requirements. My previous workaround caused me some code checkin errors. Need to fix this.
20 lines
256 B
Go
20 lines
256 B
Go
package stats
|
|
|
|
import "testing"
|
|
|
|
func TestRobinCounter(t *testing.T) {
|
|
rrc := NewRoundRobinCounter(60)
|
|
rrc.Add(0, 1)
|
|
rrc.Add(50, 2)
|
|
if rrc.Count() != 2 {
|
|
t.Fatal()
|
|
}
|
|
if rrc.Sum() != 3 {
|
|
t.Fatal()
|
|
}
|
|
/*
|
|
index out of range
|
|
*/
|
|
rrc.Add(61, 1)
|
|
}
|