Class TimeoutTracker


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

      • TimeoutTracker

        public TimeoutTracker​(Map<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​(TimeUnit unit)

        elapsedTime

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

        public int getSoTimeout()

        getSoTimeout

        Returns:
        a int.
      • getConnectionTimeout

        public int getConnectionTimeout()

        getConnectionTimeout

        Returns:
        a int.