Closed ghost closed 6 years ago
When getLatestBucket is called, buckets not in current window slide should be all reset.
getLatestBucket
.... w := newWindow(time.Millisecond*10, 2) w.Fail() time.Sleep(time.Millisecond * 20) w.Fail() fmt.Println(w.Failures()) ...
When run above code, the result should be 1, not 2. As window duration is 10ms, after sleep 20ms, all buckets are expired.
Sorry for the wrong test, sliding window works as expected.
When
getLatestBucket
is called, buckets not in current window slide should be all reset.When run above code, the result should be 1, not 2. As window duration is 10ms, after sleep 20ms, all buckets are expired.