Class RateImpl<T extends java.lang.Enum<T>>
- java.lang.Object
-
- net.sf.ehcache.statistics.extended.RateImpl<T>
-
- Type Parameters:
T- the generic type
- All Implemented Interfaces:
ExtendedStatistics.Statistic<java.lang.Double>
public class RateImpl<T extends java.lang.Enum<T>> extends java.lang.Object implements ExtendedStatistics.Statistic<java.lang.Double>
The Class RateStatistic.- Author:
- cdennis
-
-
Constructor Summary
Constructors Constructor Description RateImpl(org.terracotta.statistics.SourceStatistic<org.terracotta.statistics.observer.ChainedOperationObserver<T>> source, java.util.Set<T> targets, long averageNanos, java.util.concurrent.ScheduledExecutorService executor, int historySize, long historyNanos)Instantiates a new rate statistic.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanactive()Active.protected booleanexpire(long expiry)Check the statistic for expiry.java.util.List<org.terracotta.statistics.archive.Timestamped<java.lang.Double>>history()History.protected voidsetHistory(int historySize, long historyNanos)Set the sample history parameters.protected voidsetWindow(long averageNanos)Sets the window.protected voidstart()Start sampling.java.lang.Doublevalue()Value.
-
-
-
Constructor Detail
-
RateImpl
public RateImpl(org.terracotta.statistics.SourceStatistic<org.terracotta.statistics.observer.ChainedOperationObserver<T>> source, java.util.Set<T> targets, long averageNanos, java.util.concurrent.ScheduledExecutorService executor, int historySize, long historyNanos)
Instantiates a new rate statistic.- Parameters:
targets- the targetsaverageNanos- the average nanosexecutor- the executorhistorySize- the history sizehistoryNanos- the history nanos
-
-
Method Detail
-
active
public boolean active()
Description copied from interface:ExtendedStatistics.StatisticActive.- Specified by:
activein interfaceExtendedStatistics.Statistic<T extends java.lang.Enum<T>>- Returns:
- true, if successful
-
value
public java.lang.Double value()
Description copied from interface:ExtendedStatistics.StatisticValue.- Specified by:
valuein interfaceExtendedStatistics.Statistic<T extends java.lang.Enum<T>>- Returns:
- the t
-
history
public java.util.List<org.terracotta.statistics.archive.Timestamped<java.lang.Double>> history()
Description copied from interface:ExtendedStatistics.StatisticHistory.- Specified by:
historyin interfaceExtendedStatistics.Statistic<T extends java.lang.Enum<T>>- Returns:
- the list
-
start
protected void start()
Start sampling.
-
setWindow
protected void setWindow(long averageNanos)
Sets the window.- Parameters:
averageNanos- the new window
-
setHistory
protected void setHistory(int historySize, long historyNanos)Set the sample history parameters.- Parameters:
historySize- history sample sizehistoryNanos- history sample period
-
expire
protected boolean expire(long expiry)
Check the statistic for expiry.- Parameters:
expiry- expiry threshold- Returns:
trueif expired
-
-