T
- the generic typepublic class RateImpl<T extends Enum<T>> extends Object implements ExtendedStatistics.Statistic<Double>
Constructor and Description |
---|
RateImpl(org.terracotta.statistics.SourceStatistic<org.terracotta.statistics.observer.ChainedOperationObserver<T>> source,
Set<T> targets,
long averageNanos,
ScheduledExecutorService executor,
int historySize,
long historyNanos)
Instantiates a new rate statistic.
|
Modifier and Type | Method and Description |
---|---|
boolean |
active()
Active.
|
protected boolean |
expire(long expiry)
Check the statistic for expiry.
|
List<org.terracotta.statistics.archive.Timestamped<Double>> |
history()
History.
|
protected void |
setHistory(int historySize,
long historyNanos)
Set the sample history parameters.
|
protected void |
setWindow(long averageNanos)
Sets the window.
|
protected void |
start()
Start sampling.
|
Double |
value()
Value.
|
public RateImpl(org.terracotta.statistics.SourceStatistic<org.terracotta.statistics.observer.ChainedOperationObserver<T>> source, Set<T> targets, long averageNanos, ScheduledExecutorService executor, int historySize, long historyNanos)
targets
- the targetsaverageNanos
- the average nanosexecutor
- the executorhistorySize
- the history sizehistoryNanos
- the history nanospublic boolean active()
ExtendedStatistics.Statistic
active
in interface ExtendedStatistics.Statistic<Double>
public Double value()
ExtendedStatistics.Statistic
value
in interface ExtendedStatistics.Statistic<Double>
public List<org.terracotta.statistics.archive.Timestamped<Double>> history()
ExtendedStatistics.Statistic
history
in interface ExtendedStatistics.Statistic<Double>
protected void start()
protected void setWindow(long averageNanos)
averageNanos
- the new windowprotected void setHistory(int historySize, long historyNanos)
historySize
- history sample sizehistoryNanos
- history sample periodprotected boolean expire(long expiry)
expiry
- expiry thresholdtrue
if expiredCopyright © 2003–2016 Terracotta, Inc.. All rights reserved.