Class LatencySimpleMovingAverage

java.lang.Object
org.terracotta.statistics.derived.latency.LatencySimpleMovingAverage
All Implemented Interfaces:
LatencyStatistic, ChainedEventObserver, ChainedObserver

public class LatencySimpleMovingAverage extends Object implements ChainedEventObserver, LatencyStatistic
  • Field Details

  • Constructor Details

    • LatencySimpleMovingAverage

      public LatencySimpleMovingAverage(long time, TimeUnit unit)
    • LatencySimpleMovingAverage

      public LatencySimpleMovingAverage(long time, TimeUnit unit, int partitionCount)
  • Method Details

    • average

      public final double average()
      Specified by:
      average in interface LatencyStatistic
      Returns:
      The average in ns or NaN if no value
    • maximum

      public final Long maximum()
      Specified by:
      maximum in interface LatencyStatistic
      Returns:
      The maximum in ns or null if it does not exist yet
    • minimum

      public final Long minimum()
      Specified by:
      minimum in interface LatencyStatistic
      Returns:
      The minimum in ns or null if it does not exist yet
    • event

      public void event(long timeNs, long latencyNs)
      Description copied from interface: ChainedEventObserver
      Called to indicate an event happened.
      Specified by:
      event in interface ChainedEventObserver
      Parameters:
      timeNs - the clock at event completion in ns
      latencyNs - the event latency in ns
    • archive

      private void archive(LatencyPeriodAccumulator partition)