Top Fields Constructors Methods
org.terracotta.statistics

public abstract Class AbstractOperationStatistic<T extends java.lang.Enum<T>>

extends AbstractSourceStatistic<ChainedOperationObserver<? super T extends Enum<T>>>
implements OperationStatistic<T extends Enum<T>>
Class Inheritance
All Implemented Interfaces
org.terracotta.statistics.OperationStatistic, org.terracotta.statistics.SourceStatistic, org.terracotta.statistics.observer.OperationObserver
Known Direct Subclasses
org.terracotta.statistics.GeneralOperationStatistic
Annotations
@ContextAttribute:this
Imports
org.terracotta.context.annotations.ContextAttribute, org.terracotta.statistics.observer.ChainedOperationObserver, java.util.Collections, .EnumSet, .HashMap, .HashSet, .Map, .Set

Implementation Note

begin() and end(Enum) must be called from the same thread so that latency can be computed.

Author
cdennis

Field Summary

Modifier and TypeField and Description
public final String
private final ThreadLocal<Long>
public final Map<String, Object>
public final Set<String>
public final Class<T>
Inherited from org.terracotta.statistics.AbstractSourceStatistic:
derivedStatistics

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractOperationStatistic(String name, Set<String> tags, Map<String, ? extends Object>
a set of context properties
properties
,
Class<T>
operation result type
type
)

Create an operation statistics for a given operation result type.

Method Summary

Modifier and TypeMethod and Description
public void
begin()

Implements org.terracotta.statistics.observer.OperationObserver.begin.

Called immediately prior to the operation beginning.
public void
end(T
the operation result
result
)

Implements org.terracotta.statistics.observer.OperationObserver.end.

Called immediately after the operation completes with no interesting parameters, and with the same thread the called {begin()} before.
public long
public Class<T>
Inherited from org.terracotta.statistics.AbstractSourceStatistic:
addDerivedStatisticgetDerivedStatisticsremoveDerivedStatistic

Field Detail

nameback to summary
public final String name
Annotations
@ContextAttribute:name
operationStartTimeback to summary
private final ThreadLocal<Long> operationStartTime
propertiesback to summary
public final Map<String, Object> properties
Annotations
@ContextAttribute:properties
tagsback to summary
public final Set<String> tags
Annotations
@ContextAttribute:tags
typeback to summary
public final Class<T> type
Annotations
@ContextAttribute:type

Constructor Detail

AbstractOperationStatisticback to summary
pack-priv AbstractOperationStatistic(String name, Set<String> tags, Map<String, ? extends Object> properties, Class<T> type)

Create an operation statistics for a given operation result type.

Parameters
properties:Map<String, ? extends Object>

a set of context properties

type:Class<T>

operation result type

Method Detail

beginback to summary
public void begin()

Implements org.terracotta.statistics.observer.OperationObserver.begin.

Doc from org.terracotta.statistics.observer.OperationObserver.begin.

Called immediately prior to the operation beginning.

Annotations
@Override
endback to summary
public void end(T result)

Implements org.terracotta.statistics.observer.OperationObserver.end.

Doc from org.terracotta.statistics.observer.OperationObserver.end.

Called immediately after the operation completes with no interesting parameters, and with the same thread the called {begin()} before.

Parameters
result:T

the operation result

Annotations
@Override
sumback to summary
public long sum()

Implements org.terracotta.statistics.OperationStatistic.sum.

Annotations
@Override
typeback to summary
public Class<T> type()

Implements org.terracotta.statistics.OperationStatistic.type.

Annotations
@Override