private TimelineAppMetricCacheKey getTimelineAppMetricCacheKey(Set<String> metrics,
        String hostnames, String componentName, String spec) {

      TimelineAppMetricCacheKey metricCacheKey =
        new TimelineAppMetricCacheKey(metrics, componentName, hostnames, temporalInfo);

      // Set Uri on the cache key so the only job of the cache update is
      // tweaking the params. Note: Passing UriBuilder reference is unsafe
      // due to reuse. Also, the Uri can only be constructed with a resource
      // request which ties it to the cluster.
      metricCacheKey.setSpec(spec);

      return metricCacheKey;
    }
Populate the associated resources by making a call to the Metrics
service.

@return a collection of populated resources
@throws SystemException if unable to populate the resources
ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java