monitor/pkg/limiter_test.go

19 lines
230 B
Go
Raw Normal View History

2019-11-22 10:11:26 +00:00
package pkg
import (
"testing"
"time"
)
func TestLimiter(t *testing.T) {
limiter := NewLimiterServer(1*time.Second, 5)
for {
if limiter.IsAvailable() {
2019-11-25 06:12:08 +00:00
t.Log("hello...", limiter.reqCount)
2019-11-22 10:11:26 +00:00
} else {
return
}
}
}