code: public void processMetricAggregation() {
          if (!isEmpty(metricAggregation)) {
              String[] aggregations = metricAggregation.split(";");
              for (int i = 0; i < aggregations.length; i++) {
                  String definition = aggregations[i].trim();
                  int index0 = definition.indexOf("=");
                  int index1 = definition.indexOf("(");
                  int index2 = definition.indexOf(")");
                  String aggregatedName = definition.substring(0, index0);
                  String operation = definition.substring(index0 + 1, index1);
                  String parameters = definition.substring(index1 + 1, index2);
                  List<String> metricNames = new ArrayList<>();
                  metricNames.add(operation);
                  // Case a list of metricNames
                  if (parameters.contains(",")) {
                      String[] listMetricNames = parameters.split(",");
                      for (int j = 0; j < listMetricNames.length; j++) {
                          metricNames.add(listMetricNames[j].trim());
                      }
                  } else {
                      Pattern pattern = Pattern.compile(parameters);
                      for (String metricName : nameIdMetrics.keySet()) {
                          if (pattern.matcher(metricName).matches()) {
                              metricNames.add(metricName);
                          }
                      }
                  }
                  aggregatedMetrics.put(aggregatedName, metricNames);
              }
              log.debugf("Gnocchi Aggregated Metrics from %s -> %s", metricAggregation, aggregatedMetrics);
          }
      }
docs: /*
  <aggregated_metric_name>=<aggregated_function>(<list_of_metric_names>|<regexp>);