21 package com.griddynamics.jagger.engine.e1.collector;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
26 import static com.griddynamics.jagger.util.StandardMetricsNamesUtil.SUM_AGGREGATOR_ID;
37 return new SumMetricAggregator();
40 private static class SumMetricAggregator
implements MetricAggregator<Number> {
42 Logger log = LoggerFactory.getLogger(SumMetricAggregator.class);
47 public void append(Number calculated) {
48 log.debug(
"append({})", calculated);
52 sum += calculated.doubleValue();
56 public Number getAggregated() {
60 return sum.doubleValue();
65 log.debug(
"Reset aggregator");
70 public String getName() {
71 return SUM_AGGREGATOR_ID;
75 public String toString() {
76 return "SumMetricAggregator{" +