code: private void reportSampled(final String name,
                                final Sampling sampled,
                                final boolean isDuration) {
        EnumSet<MetricField> fields = reportedMetrics.get(name);
        if(fields == null) {
           return;
        }
  
        String nrName = isDuration ? buildDuration(name) : buildName(name);
  
        if(fields.contains(MetricField.MEDIAN)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().getMedian());
        }
  
        if(fields.contains(MetricField.MAX)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().getMax());
        }
  
        if(fields.contains(MetricField.MIN)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().getMin());
        }
  
        if(fields.contains(MetricField.P75)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().get75thPercentile());
        }
  
        if(fields.contains(MetricField.P95)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().get95thPercentile());
        }
  
        if(fields.contains(MetricField.P98)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().get98thPercentile());
        }
  
        if(fields.contains(MetricField.P99)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().get99thPercentile());
        }
  
        if(fields.contains(MetricField.P999)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().get999thPercentile());
        }
  
        if(fields.contains(MetricField.STD)) {
           NewRelic.recordMetric(nrName, (float)sampled.getSnapshot().getStdDev());
        }
     }
docs: Reports a sampling (timer, histogram) metric.
  @param name The name.
  @param sampled The sampled metric.
  @param isDuration Is this a duration.