Examples of RateLimiter


Examples of com.linkedin.r2.transport.http.client.RateLimiter

    _executor.shutdown();
  }

  @Test
  public void testSetPeriod() {
    final RateLimiter rl = new RateLimiter(0,
                                     MAXPERIOD,
                                     20,
                                     _executor);


    _executor.scheduleAtFixedRate(new Runnable() {
      private int _period = 300;

      @Override
      public void run() {
        rl.setPeriod(_period);
        _period += 50;
      }
    }, 0, 100, TimeUnit.MILLISECONDS);

    RateLimiterRunner runner = new RateLimiterRunner(System.currentTimeMillis());
    rl.submit(runner);

    try {
      Assert.assertTrue(runner.getElapsedTime() <= MAXPERIOD, "Elapsed Time exceed MAX Period");
    } catch (Exception e) {
      Assert.fail("Unexpected failure", e);
View Full Code Here

Examples of org.voltdb.client.exampleutils.RateLimiter

            );

            // Pick the transaction rate limiter helping object to use based on user request (rate limiting or latency targeting)
            IRateLimiter limiter = autoTune ?
                    new LatencyLimiter(Con, procedure, latencyTarget, rateLimit) :
                    new RateLimiter(rateLimit);

            // Run the loader first.
            if (runLoader) {
                doLoader(poolSize);
            }
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.