monitor/pkg/limiter_test.go

21 lines
253 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() {
limiter.Increase()
t.Log("hello...", limiter.ReqCount)
} else {
return
}
}
}