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.EnumMap, .Map, .Set, java.util.concurrent.atomic.LongAdder, org.terracotta.statistics.observer.ChainedOperationObserver

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

Field Summary

Modifier and TypeField and Description
private final EnumMap<T, 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
)

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

Called immediately after the operation completes with no interesting parameters.
public void
end(T
the operation result
result
,
long...
the operation parameters
parameters
)

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

Called immediately after the operation completes.
public long
public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

countsback to summary
private final EnumMap<T, 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)

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.

Parameters
result:T

the operation result

Annotations
@Override
endback to summary
public void end(T result, long... parameters)

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

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

Called immediately after the operation completes.

Parameters
result:T

the operation result

parameters:long[]

the operation parameters

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