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 java.lang.Object implements RateLimiter.Metrics
EnhancedRateLimiter.Metricswith some implementation specific details
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAvailablePermissions()Estimates count of available permissions.longgetCycle()longgetNanosToWait()intgetNumberOfWaitingThreads()Returns an estimate of the number of threads waiting for permission in this JVM process.
-
-
-
Method Detail
-
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.
-
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
-
getNanosToWait
public long getNanosToWait()
- Returns:
- estimated time duration in nanos to wait for the next permission
-
getCycle
public long getCycle()
- Returns:
- estimated current cycle
-
-