Package com.netflix.astyanax.connectionpool.impl

Examples of com.netflix.astyanax.connectionpool.impl.SimpleRateLimiterImpl.check()


        int time = 0;
        boolean result;
        for (int i = 0; i < 10; i++) {
            time += 10;
            result = limit.check(time);
            Assert.assertTrue(result);
        }
        result = limit.check(time + 10);
        Assert.assertFalse(result);
View Full Code Here


        for (int i = 0; i < 10; i++) {
            time += 10;
            result = limit.check(time);
            Assert.assertTrue(result);
        }
        result = limit.check(time + 10);
        Assert.assertFalse(result);

        result = limit.check(time + 1000);
        Assert.assertTrue(result);
    }
View Full Code Here

            Assert.assertTrue(result);
        }
        result = limit.check(time + 10);
        Assert.assertFalse(result);

        result = limit.check(time + 1000);
        Assert.assertTrue(result);
    }

    @Test
    public void testRateLimiter2() {
View Full Code Here

        int time = 0;
        int interval = 100;
        for (int i = 0; i < 10; i++) {
            time += interval;
            boolean result = limit.check(time);
            Assert.assertTrue(result);
        }
        boolean result = limit.check(time + interval);
        Assert.assertTrue(result);
    }
View Full Code Here

        for (int i = 0; i < 10; i++) {
            time += interval;
            boolean result = limit.check(time);
            Assert.assertTrue(result);
        }
        boolean result = limit.check(time + interval);
        Assert.assertTrue(result);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.