1 package com.griddynamics.jagger.engine.e1.collector;
3 import static com.griddynamics.jagger.util.StandardMetricsNamesUtil.SUCCESS_RATE_AGGREGATOR_OK_ID;
20 return new SuccessRateAggregator();
23 private static class SuccessRateAggregator
implements MetricAggregator<Number>
25 private long passNum = 0;
26 private long failNum = 0;
29 public void append(Number calculated)
31 if (calculated.intValue() != 0)
38 public Double getAggregated() {
39 if ((failNum + passNum) == 0)
42 return (
double) (passNum) / (
double) (failNum + passNum);
50 public String getName() {
51 return SUCCESS_RATE_AGGREGATOR_OK_ID;