private TimelineMetric createTimelineMetric(long currentTimeMillis, String component, String attributeName,
                                              Number attributeValue) {
    TimelineMetric timelineMetric = new TimelineMetric();
    timelineMetric.setMetricName(attributeName);
    timelineMetric.setHostName(hostName);
    if (setInstanceId) {
      timelineMetric.setInstanceId(instanceId);
    }
    timelineMetric.setAppId(component);
    timelineMetric.setStartTime(currentTimeMillis);

    timelineMetric.getMetricValues().put(currentTimeMillis, attributeValue.doubleValue());
    return timelineMetric;
  }
Get hostname used for calculating write shard.

@return String "host1"
ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java