Class AtomicRateLimiter.AtomicRateLimiterMetrics
java.lang.Object
io.github.resilience4j.ratelimiter.internal.AtomicRateLimiter.AtomicRateLimiterMetrics
- All Implemented Interfaces:
RateLimiter.Metrics
- Enclosing class:
- AtomicRateLimiter
public class AtomicRateLimiter.AtomicRateLimiterMetrics
extends Object
implements RateLimiter.Metrics
Enhanced
RateLimiter.Metrics
with some implementation specific details-
Method Summary
Modifier and TypeMethodDescriptionint
Estimates count of available permissions.long
getCycle()
long
int
Returns an estimate of the number of threads waiting for permission in this JVM process.
-
Method Details
-
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:
getNumberOfWaitingThreads
in interfaceRateLimiter.Metrics
- Returns:
- estimate of the number of threads waiting for permission.
-
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:
getAvailablePermissions
in interfaceRateLimiter.Metrics
- Returns:
- estimated count of permissions
-
getNanosToWait
public long getNanosToWait()- Returns:
- estimated time duration in nanos to wait for the next permission
-
getCycle
public long getCycle()- Returns:
- estimated current cycle
-