Class SemaphoreBasedRateLimiter.SemaphoreBasedRateLimiterMetrics
java.lang.Object
io.github.resilience4j.ratelimiter.internal.SemaphoreBasedRateLimiter.SemaphoreBasedRateLimiterMetrics
- All Implemented Interfaces:
RateLimiter.Metrics
- Enclosing class:
SemaphoreBasedRateLimiter
private final class SemaphoreBasedRateLimiter.SemaphoreBasedRateLimiterMetrics
extends Object
implements RateLimiter.Metrics
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintEstimates count of available permissions.intReturns an estimate of the number of threads waiting for permission in this JVM process.
-
Constructor Details
-
SemaphoreBasedRateLimiterMetrics
private SemaphoreBasedRateLimiterMetrics()
-
-
Method Details
-
getAvailablePermissions
public int getAvailablePermissions()Estimates count of available permissions. Can be negative if some permissions where reserved.This method is typically used for debugging and testing purposes.
- Specified by:
getAvailablePermissionsin interfaceRateLimiter.Metrics- Returns:
- estimated count of permissions
-
getNumberOfWaitingThreads
public int getNumberOfWaitingThreads()Returns an estimate of the number of threads waiting for permission in this JVM process.This method is typically used for debugging and testing purposes.
- Specified by:
getNumberOfWaitingThreadsin interfaceRateLimiter.Metrics- Returns:
- estimate of the number of threads waiting for permission.
-