private @NotNull Aggregation createSummingAggregator(MetricField innerMetric){
  String outerSummingFieldName;
  if (!innerMetric.isSketch() && innerMetric instanceof Aggregation) {
    outerSummingFieldName=innerMetric.getName();
  }
 else {
    outerSummingFieldName=innerMetric.getName() + "_sum";
  }
  if (innerMetric.isFloatingPoint()) {
    return new DoubleSumAggregation(outerSummingFieldName,innerMetric.getName());
  }
  return new LongSumAggregation(outerSummingFieldName,innerMetric.getName());
}

private @ NotNull Aggregation createSummingAggregator ( MetricField innerMetric ) { String outerSummingFieldName ; if ( ! innerMetric . isSketch ( ) && innerMetric instanceof Aggregation ) { outerSummingFieldName = innerMetric . getName ( ) ; } else { outerSummingFieldName = innerMetric . getName ( ) + "_sum" ; } if ( innerMetric . isFloatingPoint ( ) ) { return new DoubleSumAggregation ( outerSummingFieldName , innerMetric . getName ( ) ) ; } return new LongSumAggregation ( outerSummingFieldName , innerMetric . getName ( ) ) ; }
create an aggregation for summing on a metric from an inner query .
