org.terracotta.statistics
Class AbstractOperationStatistic<T extends Enum<T>>

java.lang.Object
  extended by org.terracotta.statistics.AbstractSourceStatistic<ChainedOperationObserver<? super T>>
      extended by org.terracotta.statistics.AbstractOperationStatistic<T>
All Implemented Interfaces:
OperationObserver<T>, OperationStatistic<T>, SourceStatistic<ChainedOperationObserver<? super T>>

public abstract class AbstractOperationStatistic<T extends Enum<T>>
extends AbstractSourceStatistic<ChainedOperationObserver<? super T>>
implements OperationStatistic<T>

Author:
cdennis

Field Summary
 String name
           
 Map<String,Object> properties
           
 Set<String> tags
           
 Class<T> type
           
 
Fields inherited from class org.terracotta.statistics.AbstractSourceStatistic
derivedStatistics
 
Method Summary
 void begin()
          Called immediately prior to the operation beginning.
 ValueStatistic<Long> statistic(Set<T> results)
           
 ValueStatistic<Long> statistic(T result)
          Return a returning the count for the given result.
 long sum()
           
 Class<T> type()
           
 
Methods inherited from class org.terracotta.statistics.AbstractSourceStatistic
addDerivedStatistic, removeDerivedStatistic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.terracotta.statistics.OperationStatistic
count, sum
 
Methods inherited from interface org.terracotta.statistics.observer.OperationObserver
end, end
 
Methods inherited from interface org.terracotta.statistics.SourceStatistic
addDerivedStatistic, removeDerivedStatistic
 

Field Detail

name

public final String name

tags

public final Set<String> tags

properties

public final Map<String,Object> properties

type

public final Class<T extends Enum<T>> type
Method Detail

type

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

statistic

public ValueStatistic<Long> statistic(T result)
Return a returning the count for the given result.

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

statistic

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

sum

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

begin

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

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


Copyright © 2016. All Rights Reserved.