Class LatencyPeriodAccumulator
- java.lang.Object
-
- org.terracotta.statistics.derived.latency.LatencyPeriodAccumulator
-
- All Implemented Interfaces:
LatencyStatistic,ChainedEventObserver,ChainedObserver
public class LatencyPeriodAccumulator extends java.lang.Object implements LatencyStatistic, ChainedEventObserver
-
-
Field Summary
Fields Modifier and Type Field Description private LatencyAccumulatoraccumulatorprivate longendprivate longstart
-
Constructor Summary
Constructors Constructor Description LatencyPeriodAccumulator(long start, long length, long... latencies)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LatencyAccumulatoraccumulator()doubleaverage()longend()voidevent(long timeNs, long latencyNs)Called to indicate an event happened.booleanisAfter(long time)booleanisBefore(long time)java.lang.Longmaximum()java.lang.Longminimum()longstart()java.lang.StringtoString()booleantryAccumulate(long time, long latency)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.terracotta.statistics.derived.latency.LatencyStatistic
averageStatistic, maximumStatistic, minimumStatistic
-
-
-
-
Field Detail
-
accumulator
private final LatencyAccumulator accumulator
-
start
private final long start
-
end
private final long end
-
-
Method Detail
-
isBefore
public boolean isBefore(long time)
-
isAfter
public boolean isAfter(long time)
-
start
public long start()
- Returns:
- Start time (inclusive) for this period.
-
end
public long end()
- Returns:
- End time (exclusive) for this period.
-
accumulator
public LatencyAccumulator accumulator()
-
tryAccumulate
public boolean tryAccumulate(long time, long latency)
-
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
-
minimum
public java.lang.Long minimum()
- Specified by:
minimumin interfaceLatencyStatistic- Returns:
- The minimum in ns or null if it does not exist yet
-
maximum
public java.lang.Long maximum()
- Specified by:
maximumin interfaceLatencyStatistic- Returns:
- The maximum in ns or null if it does not exist yet
-
average
public double average()
- Specified by:
averagein interfaceLatencyStatistic- Returns:
- The average in ns or NaN if no value
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-