Class SemiExpiringStatistic<T extends java.lang.Number>
- java.lang.Object
-
- net.sf.ehcache.statistics.extended.SemiExpiringStatistic<T>
-
- Type Parameters:
T- statistic type
- All Implemented Interfaces:
ExtendedStatistics.Statistic<T>
public class SemiExpiringStatistic<T extends java.lang.Number> extends java.lang.ObjectStatistic implementation that stops sampling history if the last history access is before a user supplied timestamp.- Author:
- Chris Dennis
-
-
Constructor Summary
Constructors Constructor Description SemiExpiringStatistic(org.terracotta.statistics.ValueStatistic<T> source, java.util.concurrent.ScheduledExecutorService executor, int historySize, long historyNanos)Creates a new semi-expiring statistic.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanactive()Active.protected booleanexpire(long expiry)Expire.java.util.List<org.terracotta.statistics.archive.Timestamped<T>>history()History.protected voidstart()Start.protected voidstartStatistic()Start statistic.protected voidstopStatistic()Stop statistic.protected voidtouch()Touch.Tvalue()Value.
-
-
-
Constructor Detail
-
SemiExpiringStatistic
public SemiExpiringStatistic(org.terracotta.statistics.ValueStatistic<T> source, java.util.concurrent.ScheduledExecutorService executor, int historySize, long historyNanos)
Creates a new semi-expiring statistic.- Parameters:
source- statistic sourceexecutor- executor to use for samplinghistorySize- size of sample historyhistoryNanos- period between samples
-
-
Method Detail
-
history
public java.util.List<org.terracotta.statistics.archive.Timestamped<T>> history()
History.- Specified by:
historyin interfaceExtendedStatistics.Statistic<T extends java.lang.Number>- Returns:
- the list
-
active
public final boolean active()
Description copied from interface:ExtendedStatistics.StatisticActive.- Returns:
- true, if successful
-
touch
protected final void touch()
Touch.
-
start
protected final void start()
Start.
-
expire
protected final boolean expire(long expiry)
Expire.- Parameters:
expiry- the expiry- Returns:
- true, if successful
-
stopStatistic
protected void stopStatistic()
Stop statistic.
-
startStatistic
protected void startStatistic()
Start statistic.
-
value
public T value()
Value.- Specified by:
valuein interfaceExtendedStatistics.Statistic<T extends java.lang.Number>- Returns:
- the t
-
-