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
- Author:
- cdennis, Mathieu Carbou
-
-
Constructor Summary
Constructors Constructor Description LatencySimpleMovingAverage(long time, TimeUnit unit)LatencySimpleMovingAverage(long time, TimeUnit unit, int partitionCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleaverage()voidevent(long timeNs, long latencyNs)Called to indicate an event happened.Longmaximum()Longminimum()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.terracotta.statistics.derived.latency.LatencyStatistic
averageStatistic, maximumStatistic, minimumStatistic
-
-
-
-
Method Detail
-
average
public final double average()
- Specified by:
averagein interfaceLatencyStatistic- Returns:
- The average in ns or NaN if no value
-
maximum
public final Long maximum()
- Specified by:
maximumin interfaceLatencyStatistic- Returns:
- The maximum in ns or null if it does not exist yet
-
minimum
public final Long minimum()
- Specified by:
minimumin interfaceLatencyStatistic- 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:ChainedEventObserverCalled to indicate an event happened.- Specified by:
eventin interfaceChainedEventObserver- Parameters:
timeNs- the clock at event completion in nslatencyNs- the event latency in ns
-
-