ehcache

net.sf.ehcache.statistics.extended
Class SemiExpiringStatistic<T extends Number>

java.lang.Object
  extended by net.sf.ehcache.statistics.extended.SemiExpiringStatistic<T>
Type Parameters:
T - statistic type
All Implemented Interfaces:
ExtendedStatistics.Statistic<T>

public class SemiExpiringStatistic<T extends Number>
extends Object

Statistic implementation that stops sampling history if the last history access is before a user supplied timestamp.

Author:
Chris Dennis

Constructor Summary
SemiExpiringStatistic(org.terracotta.statistics.ValueStatistic<T> source, ScheduledExecutorService executor, int historySize, long historyNanos)
          Creates a new semi-expiring statistic.
 
Method Summary
 boolean active()
          Active.
protected  boolean expire(long expiry)
          Expire.
 List<org.terracotta.statistics.archive.Timestamped<T>> history()
          History.
protected  void start()
          Start.
protected  void startStatistic()
          Start statistic.
protected  void stopStatistic()
          Stop statistic.
protected  void touch()
          Touch.
 T value()
          Value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemiExpiringStatistic

public SemiExpiringStatistic(org.terracotta.statistics.ValueStatistic<T> source,
                             ScheduledExecutorService executor,
                             int historySize,
                             long historyNanos)
Creates a new semi-expiring statistic.

Parameters:
source - statistic source
executor - executor to use for sampling
historySize - size of sample history
historyNanos - period between samples
Method Detail

history

public List<org.terracotta.statistics.archive.Timestamped<T>> history()
History.

Specified by:
history in interface ExtendedStatistics.Statistic<T extends Number>
Returns:
the list

active

public final boolean active()
Description copied from interface: ExtendedStatistics.Statistic
Active.

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:
value in interface ExtendedStatistics.Statistic<T extends Number>
Returns:
the t

ehcache

Copyright 2001-2016, Terracotta, Inc.