public void checkLimit() {
    if (!rateLimiter.tryAcquire()) {
      rejectSensor.record();
      throw new KsqlRateLimitException("Host is at rate limit for pull queries. Currently set to "
          + rateLimiter.getRate() + " qps.");
    }
  }
@Test
  public void shouldSucceedUnderLimit() {
    final Metrics metrics = new Metrics();
    final Map<String, String> tags = Collections.emptyMap();
    // It doesn't look like the underlying guava rate limiter has a way to control time, so we're
    // just going to have to hope that these tests reliably run in under a second.
    final RateLimiter limiter = new RateLimiter(1, METRIC_NAMESPACE, metrics, tags);

    assertThat(getReject(metrics, tags), is(0.0));

    limiter.checkLimit();

    assertThat(getReject(metrics, tags), is(0.0));
  }