Package org.terracotta.statistics
Class ZeroOperationStatistic<T extends Enum<T>>
java.lang.Object
org.terracotta.statistics.ZeroOperationStatistic<T>
- All Implemented Interfaces:
OperationObserver<T>,OperationStatistic<T>,SourceStatistic<ChainedOperationObserver<? super T>>
public class ZeroOperationStatistic<T extends Enum<T>>
extends Object
implements OperationStatistic<T>
An operation statistic that always return 0 for everything. Used as a null object.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDerivedStatistic(ChainedOperationObserver<? super T> derived) Register the givenObserverto be called by thisSourceStatisticvoidbegin()Called immediately prior to the operation beginning.longReturn the count of operations with the given type.voidCalled immediately after the operation completes with no interesting parameters, and with the same thread the called {OperationObserver.begin()} before.static <T extends Enum<T>>
OperationStatistic<T>get()Collection<ChainedOperationObserver<? super T>>Retrieve all registered statistics.voidremoveDerivedStatistic(ChainedOperationObserver<? super T> derived) Remove the given registeredObserverfrom thisSourceStatistic.longsum()longtype()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.terracotta.statistics.OperationStatistic
statistic, statistic
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ZeroOperationStatistic
public ZeroOperationStatistic()
-
-
Method Details
-
get
-
type
- Specified by:
typein interfaceOperationStatistic<T extends Enum<T>>
-
count
Description copied from interface:OperationStatisticReturn the count of operations with the given type.- Specified by:
countin interfaceOperationStatistic<T extends Enum<T>>- Parameters:
type- the result type- Returns:
- the operation count
-
sum
- Specified by:
sumin interfaceOperationStatistic<T extends Enum<T>>
-
sum
public long sum()- Specified by:
sumin interfaceOperationStatistic<T extends Enum<T>>
-
addDerivedStatistic
Description copied from interface:SourceStatisticRegister the givenObserverto be called by thisSourceStatistic- Specified by:
addDerivedStatisticin interfaceSourceStatistic<T extends Enum<T>>- Parameters:
derived- statistic to be registered
-
removeDerivedStatistic
Description copied from interface:SourceStatisticRemove the given registeredObserverfrom thisSourceStatistic.- Specified by:
removeDerivedStatisticin interfaceSourceStatistic<T extends Enum<T>>- Parameters:
derived- statistic to be removed
-
getDerivedStatistics
Description copied from interface:SourceStatisticRetrieve all registered statistics.- Specified by:
getDerivedStatisticsin interfaceSourceStatistic<T extends Enum<T>>- Returns:
- an unmodifiable collection of all derived statistics
-
begin
public void begin()Description copied from interface:OperationObserverCalled immediately prior to the operation beginning.- Specified by:
beginin interfaceOperationObserver<T extends Enum<T>>
-
end
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 Enum<T>>- Parameters:
result- the operation result
-