Class AtomicRateLimiter.AtomicRateLimiterMetrics

    • 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:
        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