public static Map<String, PropertyInfo> getPropertyInfo(MetricDefinition def) {
    Map<String, PropertyInfo> defs = new HashMap<>();

    for (Entry<String, Metric> entry : def.getMetrics().entrySet()) {
      Metric metric = entry.getValue();
      if (metric.getName() != null) {
        PropertyInfo propertyInfo = new PropertyInfo(metric.getName(),
                metric.isTemporal(), metric.isPointInTime());
        propertyInfo.setAmsHostMetric(metric.isAmsHostMetric());
        propertyInfo.setUnit(metric.getUnit());
        defs.put(entry.getKey(), propertyInfo);
      }
    }

    return defs;
  }
@param def the metric definition
@return the converted Map required for JMX or Ganglia execution.
Format: <metric name, property info>
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java