Package org.terracotta.statistics
Class AbstractOperationStatistic<T extends java.lang.Enum<T>>
- java.lang.Object
-
- org.terracotta.statistics.AbstractSourceStatistic<ChainedOperationObserver<? super T>>
-
- org.terracotta.statistics.AbstractOperationStatistic<T>
-
- All Implemented Interfaces:
OperationObserver<T>,OperationStatistic<T>,SourceStatistic<ChainedOperationObserver<? super T>>
- Direct Known Subclasses:
GeneralOperationStatistic
public abstract class AbstractOperationStatistic<T extends java.lang.Enum<T>> extends AbstractSourceStatistic<ChainedOperationObserver<? super T>> implements OperationStatistic<T>
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.Stringnameprivate java.lang.ThreadLocal<java.lang.Long>operationStartTimejava.util.Map<java.lang.String,java.lang.Object>propertiesjava.util.Set<java.lang.String>tagsjava.lang.Class<T>type-
Fields inherited from class org.terracotta.statistics.AbstractSourceStatistic
derivedStatistics
-
-
Constructor Summary
Constructors Constructor Description AbstractOperationStatistic(java.lang.String name, java.util.Set<java.lang.String> tags, java.util.Map<java.lang.String,? extends java.lang.Object> properties, java.lang.Class<T> type)Create an operation statistics for a given operation result type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin()Called immediately prior to the operation beginning.voidend(T result)Called immediately after the operation completes with no interesting parameters, and with the same thread the called {OperationObserver.begin()} before.longsum()java.lang.Class<T>type()-
Methods inherited from class org.terracotta.statistics.AbstractSourceStatistic
addDerivedStatistic, getDerivedStatistics, removeDerivedStatistic
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.terracotta.statistics.OperationStatistic
count, statistic, statistic, sum
-
Methods inherited from interface org.terracotta.statistics.SourceStatistic
addDerivedStatistic, getDerivedStatistics, removeDerivedStatistic
-
-
-
-
Constructor Detail
-
AbstractOperationStatistic
AbstractOperationStatistic(java.lang.String name, java.util.Set<java.lang.String> tags, java.util.Map<java.lang.String,? extends java.lang.Object> properties, java.lang.Class<T> type)Create an operation statistics for a given operation result type.- Parameters:
properties- a set of context propertiestype- operation result type
-
-
Method Detail
-
type
public java.lang.Class<T> type()
- Specified by:
typein interfaceOperationStatistic<T extends java.lang.Enum<T>>
-
sum
public long sum()
- Specified by:
sumin interfaceOperationStatistic<T extends java.lang.Enum<T>>
-
begin
public void begin()
Description copied from interface:OperationObserverCalled immediately prior to the operation beginning.- Specified by:
beginin interfaceOperationObserver<T extends java.lang.Enum<T>>
-
end
public void end(T result)
Description copied from interface:OperationObserverCalled immediately after the operation completes with no interesting parameters, and with the same thread the called {OperationObserver.begin()} before.- Specified by:
endin interfaceOperationObserver<T extends java.lang.Enum<T>>- Parameters:
result- the operation result
-
-