@Override
  public GraphiteEvent druidEventToGraphite(ServiceMetricEvent serviceMetricEvent)
  {
    if (!this.isInWhiteList(serviceMetricEvent)) {
      return null;
    }
    final ImmutableList.Builder<String> metricPathBuilder = new ImmutableList.Builder<>();
    metricPathBuilder.add(this.getNamespacePrefix());
    if (!this.isIgnoreServiceName()) {
      metricPathBuilder.add(GraphiteEmitter.sanitize(serviceMetricEvent.getService()));
    }
    if (!this.isIgnoreHostname()) {
      metricPathBuilder.add(GraphiteEmitter.sanitize(serviceMetricEvent.getHost()));
    }
    List<String> dimValues = getOrderedDimValues(serviceMetricEvent);
    if (dimValues != null) {
      metricPathBuilder.addAll(dimValues);
    }
    metricPathBuilder.add(GraphiteEmitter.sanitize(serviceMetricEvent.getMetric(), this.replaceSlashWithDot()));

    return new GraphiteEvent(
        Joiner.on(".").join(metricPathBuilder.build()),
        String.valueOf(serviceMetricEvent.getValue()),
        TimeUnit.MILLISECONDS.toSeconds(serviceMetricEvent.getCreatedTime().getMillis())
    );
  }
@ Override public GraphiteEvent druidEventToGraphite ( ServiceMetricEvent serviceMetricEvent ) { if ( ! this . isInWhiteList ( serviceMetricEvent ) ) { return null ; } final ImmutableList . Builder < String > metricPathBuilder = new ImmutableList . Builder < > ( ) ; metricPathBuilder . add ( this . getNamespacePrefix ( ) ) ; if ( ! this . isIgnoreServiceName ( ) ) { metricPathBuilder . add ( GraphiteEmitter . sanitize ( serviceMetricEvent . getService ( ) ) ) ; } if ( ! this . isIgnoreHostname ( ) ) { metricPathBuilder . add ( GraphiteEmitter . sanitize ( serviceMetricEvent . getHost ( ) ) ) ; } List < String > dimValues = getOrderedDimValues ( serviceMetricEvent ) ; if ( dimValues != null ) { metricPathBuilder . addAll ( dimValues ) ; } metricPathBuilder . add ( GraphiteEmitter . sanitize ( serviceMetricEvent . getMetric ( ) , this . replaceSlashWithDot ( ) ) ) ; return new GraphiteEvent ( Joiner . on ( "." ) . join ( metricPathBuilder . build ( ) ) , String . valueOf ( serviceMetricEvent . getValue ( ) ) , TimeUnit . MILLISECONDS . toSeconds ( serviceMetricEvent . getCreatedTime ( ) . getMillis ( ) ) ) ; }
@param serviceMetricEvent druid metric event to convert

@return <tt>null</tt> if the event is not white listed, otherwise return {@link GraphiteEvent}
<p>
The metric path of the graphite event is:
<namespacePrefix>.[<druid service name>].[<druid hostname>].<white-listed dimensions>.<metric>
<p/>
The order of the dimension is the order returned by {@code getOrderedDimValues()}
Note that this path will be sanitized by replacing all the `.` or space by `_` {@link GraphiteEmitter#sanitize(String)}
</p>