public static void updateMetricsWithAggregateFunctionSupport(Map<String, Map<String, PropertyInfo>> metrics) {

    if (metrics == null || metrics.isEmpty()) {
      return;
    }

    // For every component
    for (Map.Entry<String, Map<String, PropertyInfo>> metricInfoEntry : metrics.entrySet()) {
      Map<String, PropertyInfo> metricInfo = metricInfoEntry.getValue();

      Map<String, PropertyInfo> aggregateMetrics = new HashMap<>();
      // For every metric
      for (Map.Entry<String, PropertyInfo> metricEntry : metricInfo.entrySet()) {
        // For each aggregate function id
        for (String identifierToAdd : AGGREGATE_FUNCTION_IDENTIFIERS) {
          String metricInfoKey = metricEntry.getKey() + identifierToAdd;
          // This disallows metric key suffix of the form "._sum._sum" for
          // the sake of avoiding duplicates
          if (metricInfo.containsKey(metricInfoKey)) {
            continue;
          }

          PropertyInfo propertyInfo = metricEntry.getValue();
          PropertyInfo metricInfoValue = new PropertyInfo(
            propertyInfo.getPropertyId() + identifierToAdd,
            propertyInfo.isTemporal(),
            propertyInfo.isPointInTime());
          metricInfoValue.setAmsHostMetric(propertyInfo.isAmsHostMetric());
          metricInfoValue.setAmsId(!StringUtils.isEmpty(propertyInfo.getAmsId()) ?
            propertyInfo.getAmsId() + identifierToAdd : null);
          metricInfoValue.setUnit(propertyInfo.getUnit());

          aggregateMetrics.put(metricInfoKey, metricInfoValue);
        }
      }
      metricInfo.putAll(aggregateMetrics);
    }
  }
This method adds supported propertyInfo for component metrics with
aggregate function ids. API calls with multiple aggregate functions
applied to a single metric need this support.

Currently this support is added only for Component & Report metrics.
This can be easily extended by making the call from the appropriate
sub class of: @AMSPropertyProvider.
ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java