code: @Override
    public TimelineMetric druidEventToTimelineMetric(ServiceMetricEvent serviceMetricEvent)
    {
      if (!this.isInWhiteList(serviceMetricEvent)) {
        return null;
      }
      final ImmutableList.Builder<String> metricNameBuilder = new ImmutableList.Builder<>();
      if (!Strings.isNullOrEmpty(namespacePrefix)) {
        metricNameBuilder.add(namespacePrefix);
      }
      metricNameBuilder.add(AmbariMetricsEmitter.sanitize(serviceMetricEvent.getService()));
      metricNameBuilder.addAll(this.getOrderedDimValues(serviceMetricEvent));
      metricNameBuilder.add(AmbariMetricsEmitter.sanitize(serviceMetricEvent.getMetric()));
  
      TimelineMetric metric = new TimelineMetric();
      metric.setMetricName(Joiner.on(".").join(metricNameBuilder.build()));
      metric.setAppId(appName);
      metric.setHostName(serviceMetricEvent.getHost());
      metric.setType(serviceMetricEvent.getFeed());
      metric.setInstanceId(serviceMetricEvent.getService());
      long ts = serviceMetricEvent.getCreatedTime().getMillis();
      metric.setStartTime(ts);
      metric.setTimestamp(ts);
      metric.getMetricValues().put(ts, serviceMetricEvent.getValue().doubleValue());
      return metric;
    }
docs: @param serviceMetricEvent druid metric event to convert
  
  @return <tt>null</tt> if the event is not white listed, otherwise return {@link TimelineMetric}
  <p>
  The metric name of the ambari timeline metric event is:
  <namespacePrefix>.<druid service name>.<white-listed dimensions>.<metric>
  <p/>
  The order of the dimension is the order returned by {@code getOrderedDimValues()}
  Note that this name will be sanitized by replacing all the `.` or space by `_` {@link AmbariMetricsEmitter#sanitize(String)}
  </p>