Class RetryStats


  • public class RetryStats
    extends java.lang.Object
    A class that maintains stats on retries during a request. This object tracks statistics about retries performed during requests. It can be accessed from within retry handlers (see RetryHandler) or after a request is finished by calling Request.getRetryStats().
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getDelayMs()
      Returns the total time delayed (slept) between retry events.
      int getNumExceptions​(java.lang.Class<? extends java.lang.Throwable> e)
      Returns the number of exceptions of a particular class.
      int getRetries()
      Returns the number of retry events.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getNumExceptions

        public int getNumExceptions​(java.lang.Class<? extends java.lang.Throwable> e)
        Returns the number of exceptions of a particular class. If no exceptions of this class were added to this stats object, the return value is zero.
        Parameters:
        e - the class of exception to query
        Returns:
        the number of exceptions of this class
      • getDelayMs

        public int getDelayMs()
        Returns the total time delayed (slept) between retry events.
        Returns:
        time delayed during retries, in milliseconds. This is only the time spent locally in sleep() between retry events.
      • getRetries

        public int getRetries()
        Returns the number of retry events.
        Returns:
        number of retry events
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object