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)
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. |
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
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 tonewStat
- stat with the data samplesourceTaskName
- 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 Taskerror
- Exception that should be handledsourceTaskName
- name of the new stat's source