Top Fields Constructors Methods
org.terracotta.statistics

public Class MappedOperationStatistic<S extends java.lang.Enum<S>, D extends java.lang.Enum<D>>

extends Object
implements OperationStatistic<D extends Enum<D>>
Class Inheritance
All Implemented Interfaces
org.terracotta.statistics.OperationStatistic, org.terracotta.statistics.SourceStatistic, org.terracotta.statistics.observer.OperationObserver
Annotations
@ContextAttribute:this
Imports
org.terracotta.context.ContextManager, .TreeNode, org.terracotta.context.annotations.ContextAttribute, org.terracotta.context.query.Matcher, .Matchers, .Query, org.terracotta.statistics.observer.ChainedOperationObserver, java.util.Collections, .HashMap, .Map, .Map.Entry, .Set

Field Summary

Modifier and TypeField and Description
private final StatisticMapper<S, D>
public final String
public final Class<D>
public final Map<String, Object>
public final Set<String>

Constructor Summary

AccessConstructor and Description
public
MappedOperationStatistic(Object tier, Map<D, Set<S>> translation, String statisticName, int tierHeight, String targetName, String discriminator)

Method Summary

Modifier and TypeMethod and Description
public void
addDerivedStatistic(final ChainedOperationObserver<? super D>
statistic to be registered
derived
)

Implements org.terracotta.statistics.SourceStatistic.addDerivedStatistic.

Register the given Observer to be called by this SourceStatistic
public void
begin()

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

Called immediately prior to the operation beginning.
public long
count(D
the result type
type
)

Implements org.terracotta.statistics.OperationStatistic.count.

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

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

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

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

Called immediately after the operation completes.
private static <S extends Enum<S>> OperationStatistic<S>
findOperationStat(Object rootNode, final Class<S> statisticType, final String statName)

public void
removeDerivedStatistic(ChainedOperationObserver<? super D>
statistic to be removed
derived
)

Implements org.terracotta.statistics.SourceStatistic.removeDerivedStatistic.

Remove the given registered Observer from this SourceStatistic.
public ValueStatistic<Long>
statistic(D
the result of interest
result
)

Implements org.terracotta.statistics.OperationStatistic.statistic.

Return a ValueStatistic returning the count for the given result.
public ValueStatistic<Long>
public long
public long
public Class<D>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapperback to summary
private final StatisticMapper<S, D> mapper
nameback to summary
public final String name
Annotations
@ContextAttribute:name
outcomeTypeback to summary
public final Class<D> outcomeType
Annotations
@ContextAttribute:type
propertiesback to summary
public final Map<String, Object> properties
Annotations
@ContextAttribute:properties
tagsback to summary
public final Set<String> tags
Annotations
@ContextAttribute:tags

Constructor Detail

MappedOperationStatisticback to summary
public MappedOperationStatistic(Object tier, Map<D, Set<S>> translation, String statisticName, int tierHeight, String targetName, String discriminator)

Method Detail

addDerivedStatisticback to summary
public void addDerivedStatistic(final ChainedOperationObserver<? super D> derived)

Implements org.terracotta.statistics.SourceStatistic.addDerivedStatistic.

Doc from org.terracotta.statistics.SourceStatistic.addDerivedStatistic.

Register the given Observer to be called by this SourceStatistic

Parameters
derived:ChainedOperationObserver<? super D>

statistic to be registered

Annotations
@Override
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
countback to summary
public long count(D type)

Implements org.terracotta.statistics.OperationStatistic.count.

Doc from org.terracotta.statistics.OperationStatistic.count.

Return the count of operations with the given type.

Parameters
type:D

the result type

Returns:long

the operation count

Annotations
@Override
endback to summary
public void end(D 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:D

the operation result

Annotations
@Override
endback to summary
public void end(D 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:D

the operation result

parameters:long[]

the operation parameters

Annotations
@Override
findOperationStatback to summary
private static <S extends Enum<S>> OperationStatistic<S> findOperationStat(Object rootNode, final Class<S> statisticType, final String statName)
Annotations
@SuppressWarnings:unchecked
removeDerivedStatisticback to summary
public void removeDerivedStatistic(ChainedOperationObserver<? super D> derived)

Implements org.terracotta.statistics.SourceStatistic.removeDerivedStatistic.

Doc from org.terracotta.statistics.SourceStatistic.removeDerivedStatistic.

Remove the given registered Observer from this SourceStatistic.

Parameters
derived:ChainedOperationObserver<? super D>

statistic to be removed

Annotations
@Override
statisticback to summary
public ValueStatistic<Long> statistic(D result)

Implements org.terracotta.statistics.OperationStatistic.statistic.

Doc from org.terracotta.statistics.OperationStatistic.statistic.

Return a ValueStatistic returning the count for the given result.

Parameters
result:D

the result of interest

Returns:ValueStatistic<Long>

a ValueStatistic instance

Annotations
@Override
statisticback to summary
public ValueStatistic<Long> statistic(Set<D> results)

Implements org.terracotta.statistics.OperationStatistic.statistic, org.terracotta.statistics.OperationStatistic.statistic.

Annotations
@Override
sumback to summary
public long sum(Set<D> types)

Implements org.terracotta.statistics.OperationStatistic.sum.

Annotations
@Override
sumback to summary
public long sum()

Implements org.terracotta.statistics.OperationStatistic.sum.

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

Implements org.terracotta.statistics.OperationStatistic.type.

Annotations
@Override