@Test public void permissionsInFirstCycle() throws Exception { setup(Duration.ZERO); setTimeOnNanos(CYCLE_IN_NANOS - 10); RateLimiter.Metrics metrics = rateLimiter.getMetrics(); int availablePermissions = metrics.getAvailablePermissions(); then(availablePermissions).isEqualTo(PERMISSIONS_RER_CYCLE); }
@Override public Metrics getMetrics() { return new AtomicRateLimiterMetrics(); }
AtomicRateLimiter implements RateLimiter { @Override public Metrics getMetrics() { return new AtomicRateLimiterMetrics(); } }
AtomicRateLimiter implements RateLimiter { @Override public Metrics getMetrics() { return new AtomicRateLimiterMetrics(); } AtomicRateLimiter(String name, RateLimiterConfig rateLimiterConfig);  AtomicRateLimiter(String name, RateLimiterConfig rateLimiterConfig,
                             Map<String, String> tags); }
AtomicRateLimiter implements RateLimiter { @Override public Metrics getMetrics() { return new AtomicRateLimiterMetrics(); } AtomicRateLimiter(String name, RateLimiterConfig rateLimiterConfig);  AtomicRateLimiter(String name, RateLimiterConfig rateLimiterConfig,
                             Map<String, String> tags); @Override void changeTimeoutDuration(final Duration timeoutDuration); @Override void changeLimitForPeriod(final int limitForPeriod); @Override boolean acquirePermission(final int permits); @Override long reservePermission(final int permits); @Override String getName(); @Override RateLimiterConfig getRateLimiterConfig(); @Override Map<String, String> getTags(); @Override Metrics getMetrics(); @Override EventPublisher getEventPublisher(); @Override String toString(); AtomicRateLimiterMetrics getDetailedMetrics(); }
AtomicRateLimiter implements RateLimiter { @Override public Metrics getMetrics() { return new AtomicRateLimiterMetrics(); } AtomicRateLimiter(String name, RateLimiterConfig rateLimiterConfig);  AtomicRateLimiter(String name, RateLimiterConfig rateLimiterConfig,
                             Map<String, String> tags); @Override void changeTimeoutDuration(final Duration timeoutDuration); @Override void changeLimitForPeriod(final int limitForPeriod); @Override boolean acquirePermission(final int permits); @Override long reservePermission(final int permits); @Override String getName(); @Override RateLimiterConfig getRateLimiterConfig(); @Override Map<String, String> getTags(); @Override Metrics getMetrics(); @Override EventPublisher getEventPublisher(); @Override String toString(); AtomicRateLimiterMetrics getDetailedMetrics();  }