Class TimeoutTracker


  • public class TimeoutTracker
    extends java.lang.Object
    Helper class used for tracking retires and timeouts for ServiceMonitors.
    Author:
    Ben Reed, Mathew Brozowski
    • Constructor Detail

      • TimeoutTracker

        public TimeoutTracker​(java.util.Map<java.lang.String,​?> parameters,
                              int defaultRetry,
                              int defaultTimeout)

        Constructor for TimeoutTracker.

        Parameters:
        parameters - a Map object.
        defaultRetry - a int.
        defaultTimeout - a int.
    • Method Detail

      • shouldRetry

        public boolean shouldRetry()

        shouldRetry

        Returns:
        a boolean.
      • getTimeoutInMillis

        public long getTimeoutInMillis()

        getTimeoutInMillis

        Returns:
        a long.
      • getTimeoutInSeconds

        public long getTimeoutInSeconds()

        getTimeoutInSeconds

        Returns:
        a long.
      • reset

        public void reset()

        reset

      • nextAttempt

        public void nextAttempt()

        nextAttempt

      • getAttempt

        public int getAttempt()

        getAttempt

        Returns:
        a int.
      • startAttempt

        public void startAttempt()

        startAttempt

      • elapsedTimeInMillis

        public double elapsedTimeInMillis()

        elapsedTimeInMillis

        Returns:
        a double.
      • elapsedTimeNanos

        public long elapsedTimeNanos()

        elapsedTimeNanos

        Returns:
        a long.
      • elapsedTime

        public double elapsedTime​(java.util.concurrent.TimeUnit unit)

        elapsedTime

        Parameters:
        unit - a TimeUnit object.
        Returns:
        a double.
      • toString

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

        public int getSoTimeout()

        getSoTimeout

        Returns:
        a int.
      • getConnectionTimeout

        public int getConnectionTimeout()

        getConnectionTimeout

        Returns:
        a int.