Top Description Fields Constructors Methods
org.terracotta.statistics

pack-priv Class GeneralOperationStatistic<T extends java.lang.Enum<T>>

extends AbstractOperationStatistic<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
Type Parameters
<T>
the operation result enum type
Imports
java.util.Arrays, .Map, .Set, java.util.concurrent.atomic.LongAdder, java.util.stream.Collectors, .IntStream

An operation observer that tracks operation result counts and can drive further derived statistics.

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

Field Summary

Modifier and TypeField and Description
private final LongAdder[]
Inherited from org.terracotta.statistics.AbstractOperationStatistic:
namepropertiestagstype

Constructor Summary

AccessConstructor and Description
pack-priv
GeneralOperationStatistic(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 long

Returns:

the operation count
count
(T
the result type
type
)

Implements org.terracotta.statistics.OperationStatistic.count.

Return the count of operations with the given type.
public void
end(T
the operation result
result
)

Overrides org.terracotta.statistics.AbstractOperationStatistic.end.

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 String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.terracotta.statistics.AbstractOperationStatistic:
beginsumtype

Field Detail

countsback to summary
private final LongAdder[] counts

Constructor Detail

GeneralOperationStatisticback to summary
pack-priv GeneralOperationStatistic(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

countback to summary
public long count(T type)

Implements org.terracotta.statistics.OperationStatistic.count.

Return the count of operations with the given type.

Parameters
type:T

the result type

Returns:long

the operation count

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

Overrides org.terracotta.statistics.AbstractOperationStatistic.end.

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(Set<T> types)

Implements org.terracotta.statistics.OperationStatistic.sum.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override