org.terracotta.statistics.extended
Class ExpiringSampledStatistic<T extends Number>

java.lang.Object
  extended by org.terracotta.statistics.extended.SemiExpiringSampledStatistic<T>
      extended by org.terracotta.statistics.extended.ExpiringSampledStatistic<T>
Type Parameters:
T - statistic type
All Implemented Interfaces:
SampledStatistic<T>, SamplingSupport

public class ExpiringSampledStatistic<T extends Number>
extends SemiExpiringSampledStatistic<T>

Statistic that stops sampling history when the last access is after a user supplied timestamp.

Author:
Chris Dennis

Constructor Summary
ExpiringSampledStatistic(ValueStatistic<T> source, ScheduledExecutorService executor, int historySize, long historyPeriod, TimeUnit historyTimeUnit, StatisticType type)
          Creates an expiring statistic.
 
Method Summary
 StatisticType type()
           
 T value()
          Value.
 
Methods inherited from class org.terracotta.statistics.extended.SemiExpiringSampledStatistic
active, expire, history, history, setAlwaysOn, start, startStatistic, stopStatistic, touch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpiringSampledStatistic

public ExpiringSampledStatistic(ValueStatistic<T> source,
                                ScheduledExecutorService executor,
                                int historySize,
                                long historyPeriod,
                                TimeUnit historyTimeUnit,
                                StatisticType type)
Creates an expiring statistic.

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

value

public T value()
Value.

Specified by:
value in interface SampledStatistic<T extends Number>
Returns:
the t

type

public StatisticType type()
Specified by:
type in interface SampledStatistic<T extends Number>


Copyright © 2017. All rights reserved.