public void CanTrace_DecimalQps() { var rateLimiter = TraceUtils.GetRateLimiter(0.1, new long[] { 9999, 10001 }); Assert.False(rateLimiter.CanTrace()); Assert.True(rateLimiter.CanTrace()); }
public void CreateOptions_ShouldNotTrace() { var rateLimiter = TraceUtils.GetRateLimiter(999); var factory = new RateLimitingTraceOptionsFactory(rateLimiter); Assert.False(factory.CreateOptions().ShouldTrace); }
public void CanTrace_Multiple() { var rateLimiter = TraceUtils.GetRateLimiter( 1, new long[] { 999, 1001, 1790, 1850, 2030, 2700, 5000 }); Assert.False(rateLimiter.CanTrace()); Assert.True(rateLimiter.CanTrace()); Assert.False(rateLimiter.CanTrace()); Assert.False(rateLimiter.CanTrace()); Assert.True(rateLimiter.CanTrace()); Assert.False(rateLimiter.CanTrace()); Assert.True(rateLimiter.CanTrace()); }
public void CanTrace_False() { var rateLimiter = TraceUtils.GetRateLimiter(999); Assert.False(rateLimiter.CanTrace()); }
public void CanTrace() { var rateLimiter = TraceUtils.GetRateLimiter(1001); Assert.True(rateLimiter.CanTrace()); }