Interface IntervalTimerSupplier

All Superinterfaces:
StatisticSupplier
All Known Implementing Classes:
AbstractIntervalTimerSupplier, IntervalTimer, IntervalTimerSnapshot

public interface IntervalTimerSupplier extends StatisticSupplier
Abstract statistic that represents "wall-clock" time of some runtime activity. Timers consist of a state(unavailable, started, stopped), a start time, and an end time. Timers always aggregate in the following way:
  1. The aggregated StatisticSupplier.getState() is StatisticState.UNAVAILABLE if all partitions are unavailable. Otherwise the aggregated StatisticSupplier.getState() is StatisticState.FINISHED if all partitions are StatisticState.FINISHED. Otherwise the aggregated StatisticSupplier.getState() is StatisticState.ACTIVE
  2. The aggregated getStartTimeMillis() is defined to be the minimum across all partitions
  3. The aggregated getEndTimeMillis() is defined to be the maximum across all partitions
  4. The aggregated getTimeIntervalMillis() is defined to be the difference between the aggregated getEndTimeMillis() and the aggregated getStartTimeMillis()
  • Method Details

    • getStartTimeMillis

      long getStartTimeMillis()
      This will return the start time or an undefined value if never started.
      Returns:
      the start time or an undefined value if never started.
    • getEndTimeMillis

      long getEndTimeMillis()
      Returns the end time if finished, the current time if running, or an undefined value if never started. If this timer corresponds to a snapshot of a timer that is in the StatisticState.ACTIVE state, then this value will reflect the time at which the snapshot was taken.
      Returns:
      the end time if finished, the current time if running, or an undefined value if never started
    • getTimeIntervalMillis

      long getTimeIntervalMillis()
      If state is StatisticState.ACTIVE or StatisticState.FINISHED should always return getEndTimeMillis()-getStartTimeMillis. Otherwise, value is undefined.
      Returns:
      the difference between end time and start time
    • snapshot

      Creates a snapshot of this timer. If the timer is in the StatisticState.ACTIVE
      Specified by:
      snapshot in interface StatisticSupplier
      Returns:
      a snapshot of this statistic.