ehcache

net.sf.ehcache.statistics.extended
Class RateImpl<T extends Enum<T>>

java.lang.Object
  extended by net.sf.ehcache.statistics.extended.RateImpl<T>
Type Parameters:
T - the generic type
All Implemented Interfaces:
ExtendedStatistics.Statistic<Double>

public class RateImpl<T extends Enum<T>>
extends Object
implements ExtendedStatistics.Statistic<Double>

The Class RateStatistic.

Author:
cdennis

Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RateImpl

public 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.

Parameters:
targets - the targets
averageNanos - the average nanos
executor - the executor
historySize - the history size
historyNanos - the history nanos
Method Detail

active

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

Specified by:
active in interface ExtendedStatistics.Statistic<Double>
Returns:
true, if successful

value

public Double value()
Description copied from interface: ExtendedStatistics.Statistic
Value.

Specified by:
value in interface ExtendedStatistics.Statistic<Double>
Returns:
the t

history

public List<org.terracotta.statistics.archive.Timestamped<Double>> history()
Description copied from interface: ExtendedStatistics.Statistic
History.

Specified by:
history in interface ExtendedStatistics.Statistic<Double>
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 size
historyNanos - history sample period

expire

protected boolean expire(long expiry)
Check the statistic for expiry.

Parameters:
expiry - expiry threshold
Returns:
true if expired

ehcache

Copyright 2001-2015, Terracotta, Inc.