Remove stray prints
This commit is contained in:
parent
969d1fb6b6
commit
e7fa269532
@ -129,7 +129,7 @@ func (s *slidingWindow) initialize() {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
// Prefill permits to allow tokens to be granted immediately
|
// Prefill permits to allow tokens to be granted immediately
|
||||||
for i := int(0); i < s.capacity; i++ {
|
for i := 0; i < s.capacity; i++ {
|
||||||
s.permits <- token{}
|
s.permits <- token{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ func (s *slidingWindow) slide() {
|
|||||||
|
|
||||||
s.nextInterval()
|
s.nextInterval()
|
||||||
|
|
||||||
for i := int(0); i < s.prev.count[s.currentInterval]; i++ {
|
for i := 0; i < s.prev.count[s.currentInterval]; i++ {
|
||||||
select {
|
select {
|
||||||
case s.permits <- token{}:
|
case s.permits <- token{}:
|
||||||
default:
|
default:
|
||||||
@ -186,7 +186,7 @@ func validate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if windowSize < slideInterval {
|
if windowSize < slideInterval {
|
||||||
return clues.New("window too small to fit slide interval")
|
return clues.New("window too small to fit intervals")
|
||||||
}
|
}
|
||||||
|
|
||||||
if windowSize%slideInterval != 0 {
|
if windowSize%slideInterval != 0 {
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package limiters
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
@ -126,7 +125,6 @@ func (suite *SlidingWindowUnitTestSuite) TestWaitSliding() {
|
|||||||
sums := slidingSum(data, sw.numIntervals)
|
sums := slidingSum(data, sw.numIntervals)
|
||||||
|
|
||||||
for _, sum := range sums {
|
for _, sum := range sums {
|
||||||
fmt.Printf("sum: %d\n", sum)
|
|
||||||
require.True(t, sum <= capacity, "sum: %d, capacity: %d", sum, capacity)
|
require.True(t, sum <= capacity, "sum: %d, capacity: %d", sum, capacity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user