com.grandcentral.appstats
Interface StatAggregator

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
StatAggregatorImpl

public interface StatAggregator
extends java.io.Serializable

interface for handling Stat's aggregationMethods. Very similar to a StatCalculator, except that a StatAggregator is typically implemented as a singleton.

See Also:
Stat.getAggregationMethod(), Task.flush(), Task.aggregate(com.grandcentral.appstats.Task)

Field Summary
static java.lang.String SUFFIX_AVG
           
static java.lang.String SUFFIX_AVGCOUNT
           
static java.lang.String SUFFIX_AVGSUM
           
static java.lang.String SUFFIX_EXPAVG
           
static java.lang.String SUFFIX_EXPAVGEXPONENT
           
static java.lang.String SUFFIX_MAX
           
static java.lang.String SUFFIX_MIN
           
static java.lang.String SUFFIX_SUM
           
 
Method Summary
 void aggregate(Task dest, Stat newStat, java.lang.String sourceTaskName)
          aggregates a Stat based on its statName and aggregation method.
 void processError(Task dest, java.lang.Throwable error, java.lang.String sourceTaskName)
          Processes a captured Exception and adds it to the list of exceptions.
 

Field Detail

SUFFIX_MIN

public static final java.lang.String SUFFIX_MIN

SUFFIX_MAX

public static final java.lang.String SUFFIX_MAX

SUFFIX_SUM

public static final java.lang.String SUFFIX_SUM

SUFFIX_AVG

public static final java.lang.String SUFFIX_AVG

SUFFIX_AVGSUM

public static final java.lang.String SUFFIX_AVGSUM

SUFFIX_AVGCOUNT

public static final java.lang.String SUFFIX_AVGCOUNT

SUFFIX_EXPAVG

public static final java.lang.String SUFFIX_EXPAVG

SUFFIX_EXPAVGEXPONENT

public static final java.lang.String SUFFIX_EXPAVGEXPONENT
Method Detail

aggregate

public void aggregate(Task dest,
                      Stat newStat,
                      java.lang.String sourceTaskName)
aggregates a Stat based on its statName and aggregation method. Any Stats produced by aggregation methods (e.g. min,max,avg) retain the same prefix as newStat with new suffices depending on the aggregation method (e.g. "min","max","avg"). So, in a nutshell, if you have a Stat w/ statName=="latency" and aggregationMethod==AGGREGATE_AVG|AGGREGATE_MIN|AGGREGATE_MAX this method will create in the destination task 3 stats: "latency.avg," "latency.min," and "latency.max"
Parameters:
dest - destination Task where stats will be written to
newStat - stat with the data sample
sourceTaskName - name of the new stat's source

processError

public void processError(Task dest,
                         java.lang.Throwable error,
                         java.lang.String sourceTaskName)
Processes a captured Exception and adds it to the list of exceptions. Special Aggregatiors may provide special handling.
Parameters:
dest - destination Task
error - Exception that should be handled
sourceTaskName - name of the new stat's source