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
Enhanced RateLimiter.Metrics with some implementation specific details
  • Method Summary

    Modifier and Type Method Description
    int getAvailablePermissions()
    Estimates count of available permissions.
    long getCycle()  
    long getNanosToWait()  
    int getNumberOfWaitingThreads()
    Returns an estimate of the number of threads waiting for permission in this JVM process.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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