org.terracotta.statistics
Class MappedOperationStatistic<S extends Enum<S>,D extends Enum<D>>

java.lang.Object
  extended by org.terracotta.statistics.MappedOperationStatistic<S,D>
All Implemented Interfaces:
OperationObserver<D>, OperationStatistic<D>, SourceStatistic<ChainedOperationObserver<? super D>>

public class MappedOperationStatistic<S extends Enum<S>,D extends Enum<D>>
extends Object
implements OperationStatistic<D>


Field Summary
 String name
           
 Class<D> outcomeType
           
 Map<String,Object> properties
           
 Set<String> tags
           
 
Constructor Summary
MappedOperationStatistic(Object tier, Map<D,Set<S>> translation, String statisticName, int tierHeight, String targetName, String discriminator)
           
 
Method Summary
 void addDerivedStatistic(ChainedOperationObserver<? super D> derived)
          Register the given Observer to be called by this SourceStatistic
 void begin()
          Called immediately prior to the operation beginning.
 long count(D type)
          Return the count of operations with the given type.
 void end(D result)
          Called immediately after the operation completes with no interesting parameters.
 void end(D result, long... parameters)
          Called immediately after the operation completes.
 void removeDerivedStatistic(ChainedOperationObserver<? super D> derived)
          Remove the given registered Observer from this SourceStatistic.
 ValueStatistic<Long> statistic(D result)
          Return a ValueStatistic returning the count for the given result.
 ValueStatistic<Long> statistic(Set<D> results)
           
 long sum()
           
 long sum(Set<D> types)
           
 Class<D> type()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final String name

tags

public final Set<String> tags

properties

public final Map<String,Object> properties

outcomeType

public final Class<D extends Enum<D>> outcomeType
Constructor Detail

MappedOperationStatistic

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

type

public Class<D> type()
Specified by:
type in interface OperationStatistic<D extends Enum<D>>

statistic

public ValueStatistic<Long> statistic(D result)
Description copied from interface: OperationStatistic
Return a ValueStatistic returning the count for the given result.

Specified by:
statistic in interface OperationStatistic<D extends Enum<D>>
Parameters:
result - the result of interest
Returns:
a ValueStatistic instance

statistic

public ValueStatistic<Long> statistic(Set<D> results)
Specified by:
statistic in interface OperationStatistic<D extends Enum<D>>

count

public long count(D type)
Description copied from interface: OperationStatistic
Return the count of operations with the given type.

Specified by:
count in interface OperationStatistic<D extends Enum<D>>
Parameters:
type - the result type
Returns:
the operation count

sum

public long sum(Set<D> types)
Specified by:
sum in interface OperationStatistic<D extends Enum<D>>

sum

public long sum()
Specified by:
sum in interface OperationStatistic<D extends Enum<D>>

addDerivedStatistic

public void addDerivedStatistic(ChainedOperationObserver<? super D> derived)
Description copied from interface: SourceStatistic
Register the given Observer to be called by this SourceStatistic

Specified by:
addDerivedStatistic in interface SourceStatistic<ChainedOperationObserver<? super D extends Enum<D>>>
Parameters:
derived - statistic to be registered

removeDerivedStatistic

public void removeDerivedStatistic(ChainedOperationObserver<? super D> derived)
Description copied from interface: SourceStatistic
Remove the given registered Observer from this SourceStatistic.

Specified by:
removeDerivedStatistic in interface SourceStatistic<ChainedOperationObserver<? super D extends Enum<D>>>
Parameters:
derived - statistic to be removed

begin

public void begin()
Description copied from interface: OperationObserver
Called immediately prior to the operation beginning.

Specified by:
begin in interface OperationObserver<D extends Enum<D>>

end

public void end(D result)
Description copied from interface: OperationObserver
Called immediately after the operation completes with no interesting parameters.

Specified by:
end in interface OperationObserver<D extends Enum<D>>
Parameters:
result - the operation result

end

public void end(D result,
                long... parameters)
Description copied from interface: OperationObserver
Called immediately after the operation completes.

Specified by:
end in interface OperationObserver<D extends Enum<D>>
Parameters:
result - the operation result
parameters - the operation parameters


Copyright © 2017. All rights reserved.