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 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 interface RateLimiter.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 interface RateLimiter.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