Class StepTimer

java.lang.Object
All Implemented Interfaces:
HistogramSupport, Meter, Timer

public class StepTimer
extends AbstractTimer
  • Constructor Details

    • StepTimer

      public StepTimer​(Meter.Id id, Clock clock, DistributionStatisticConfig distributionStatisticConfig, PauseDetector pauseDetector, java.util.concurrent.TimeUnit baseTimeUnit, long stepDurationMillis, boolean supportsAggregablePercentiles)
      Create a new StepTimer.
      Parameters:
      id - ID
      clock - clock
      distributionStatisticConfig - distribution statistic configuration
      pauseDetector - pause detector
      baseTimeUnit - base time unit
      stepDurationMillis - step in milliseconds
      supportsAggregablePercentiles - whether it supports aggregable percentiles
  • Method Details

    • recordNonNegative

      protected void recordNonNegative​(long amount, java.util.concurrent.TimeUnit unit)
      Specified by:
      recordNonNegative in class AbstractTimer
    • count

      public long count()
      Returns:
      The number of times that stop has been called on this timer.
    • totalTime

      public double totalTime​(java.util.concurrent.TimeUnit unit)
      Parameters:
      unit - The base unit of time to scale the total to.
      Returns:
      The total time of recorded events.
    • max

      public double max​(java.util.concurrent.TimeUnit unit)
      Parameters:
      unit - The base unit of time to scale the max to.
      Returns:
      The maximum time of a single event.