org.terracotta.statistics
Class AbstractSourceStatistic<T extends ChainedObserver>

java.lang.Object
  extended by org.terracotta.statistics.AbstractSourceStatistic<T>
All Implemented Interfaces:
SourceStatistic<T>
Direct Known Subclasses:
AbstractOperationStatistic, LatencySampling, OperationResultFilter

public class AbstractSourceStatistic<T extends ChainedObserver>
extends Object
implements SourceStatistic<T>

An abstract SourceStatistic that handles derived statistic (de)registration.

This implementation exposes the currently registered statistics via the #derived() method. Concrete implementations of this class should fire on the contents of this Iterable to update the derived statistics.


Field Summary
protected  Collection<T> derivedStatistics
           
 
Constructor Summary
AbstractSourceStatistic()
           
 
Method Summary
 void addDerivedStatistic(T derived)
          Register the given Observer to be called by this SourceStatistic
 void removeDerivedStatistic(T derived)
          Remove the given registered from this SourceStatistic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

derivedStatistics

protected final Collection<T extends ChainedObserver> derivedStatistics
Constructor Detail

AbstractSourceStatistic

public AbstractSourceStatistic()
Method Detail

addDerivedStatistic

public void addDerivedStatistic(T derived)
Description copied from interface: SourceStatistic
Register the given Observer to be called by this SourceStatistic

Specified by:
addDerivedStatistic in interface SourceStatistic<T extends ChainedObserver>
Parameters:
derived - statistic to be registered

removeDerivedStatistic

public void removeDerivedStatistic(T derived)
Description copied from interface: SourceStatistic
Remove the given registered from this SourceStatistic.

Specified by:
removeDerivedStatistic in interface SourceStatistic<T extends ChainedObserver>
Parameters:
derived - statistic to be removed


Copyright © 2016. All Rights Reserved.