* object
*/
TaskAggregateStats(ProfileCollector collector, String name) {
super(notificationInfo);
this.collector = collector;
ProfileConsumer consumer = collector.getConsumer(name);
// We could determine that some of these statistics need to be
// on all the time (level MIN) so we can use them for load balancing
// or because they are extremely useful.
//
// Note that if the counters are all on the time, we could just
// as easily use AtomicLongs rather than AggregateProfileCounters.
ProfileLevel level = ProfileLevel.MEDIUM;
// These statistics are reported to the profile reports
// directly, with the ProfileCollector.
// They should not be reported as TASK_AND_AGGREGATE because,
// for nested tasks, we don't want to merge their values into
// the parent's value.
ProfileDataType type = ProfileDataType.AGGREGATE;
numTasks = (AggregateProfileCounter)
consumer.createCounter("numTasks", type, level);
numTransactionalTasks = (AggregateProfileCounter)
consumer.createCounter("numTransactionalTasks", type, level);
numFailedTasks = (AggregateProfileCounter)
consumer.createCounter("numFailedTasks", type, level);
readyCount = (AggregateProfileSample)
consumer.createSample("readyCount", type, level);
runtime = (AggregateProfileSample)
consumer.createSample("runtime", type, level);
lagtime = (AggregateProfileSample)
consumer.createSample("lagTime", type, level);
latency = (AggregateProfileSample)
consumer.createSample("latency", type, level);
setSmoothing(smoothingFactor);
}