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 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:
      getAvailablePermissions in interface RateLimiter.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:
      getNumberOfWaitingThreads in interface RateLimiter.Metrics
      Returns:
      estimate of the number of threads waiting for permission.