private void pushSampling(MetricName name, Sampling sampling, Long epoch) {
   final Snapshot snapshot = sampling.getSnapshot();
   maybeExpand(Expansions.MEDIAN, name, snapshot.getMedian(), epoch);
   maybeExpand(Expansions.P75, name, snapshot.get75thPercentile(), epoch);
   maybeExpand(Expansions.P95, name, snapshot.get95thPercentile(), epoch);
   maybeExpand(Expansions.P98, name, snapshot.get98thPercentile(), epoch);
   maybeExpand(Expansions.P99, name, snapshot.get99thPercentile(), epoch);
   maybeExpand(Expansions.P999, name, snapshot.get999thPercentile(), epoch);
 }
 public void sendSample(MetricName name, Sampling metric, Long epoch) {
   final Snapshot s = metric.getSnapshot();
   newEvent().time(epoch).service(service(name, ".5")).metric(s.getMedian()).send();
   newEvent().time(epoch).service(service(name, ".75")).metric(s.get75thPercentile()).send();
   newEvent().time(epoch).service(service(name, ".95")).metric(s.get95thPercentile()).send();
   newEvent().time(epoch).service(service(name, ".98")).metric(s.get98thPercentile()).send();
   newEvent().time(epoch).service(service(name, ".99")).metric(s.get99thPercentile()).send();
   newEvent().time(epoch).service(service(name, ".999")).metric(s.get999thPercentile()).send();
 }
 protected void sendSampling(String sanitizedName, Sampling metric) throws IOException {
   final Snapshot snapshot = metric.getSnapshot();
   sendFloat(sanitizedName + ".median", StatType.TIMER, snapshot.getMedian());
   sendFloat(sanitizedName + ".75percentile", StatType.TIMER, snapshot.get75thPercentile());
   sendFloat(sanitizedName + ".95percentile", StatType.TIMER, snapshot.get95thPercentile());
   sendFloat(sanitizedName + ".98percentile", StatType.TIMER, snapshot.get98thPercentile());
   sendFloat(sanitizedName + ".99percentile", StatType.TIMER, snapshot.get99thPercentile());
   sendFloat(sanitizedName + ".999percentile", StatType.TIMER, snapshot.get999thPercentile());
 }
 @Override
 public void processHistogram(MetricName name, Histogram histogram, PrintStream stream) {
   final Snapshot snapshot = histogram.getSnapshot();
   stream.printf(locale, "               min = %2.2f\n", histogram.getMin());
   stream.printf(locale, "               max = %2.2f\n", histogram.getMax());
   stream.printf(locale, "              mean = %2.2f\n", histogram.getMean());
   stream.printf(locale, "            stddev = %2.2f\n", histogram.getStdDev());
   stream.printf(locale, "            median = %2.2f\n", snapshot.getMedian());
   stream.printf(locale, "              75%% <= %2.2f\n", snapshot.get75thPercentile());
   stream.printf(locale, "              95%% <= %2.2f\n", snapshot.get95thPercentile());
   stream.printf(locale, "              98%% <= %2.2f\n", snapshot.get98thPercentile());
   stream.printf(locale, "              99%% <= %2.2f\n", snapshot.get99thPercentile());
   stream.printf(locale, "            99.9%% <= %2.2f\n", snapshot.get999thPercentile());
 }
 @Override
 public void processTimer(MetricName name, Timer timer, PrintStream stream) {
   processMeter(name, timer, stream);
   final String durationUnit = abbrev(timer.getDurationUnit());
   final Snapshot snapshot = timer.getSnapshot();
   stream.printf(locale, "               min = %2.2f%s\n", timer.getMin(), durationUnit);
   stream.printf(locale, "               max = %2.2f%s\n", timer.getMax(), durationUnit);
   stream.printf(locale, "              mean = %2.2f%s\n", timer.getMean(), durationUnit);
   stream.printf(locale, "            stddev = %2.2f%s\n", timer.getStdDev(), durationUnit);
   stream.printf(locale, "            median = %2.2f%s\n", snapshot.getMedian(), durationUnit);
   stream.printf(
       locale, "              75%% <= %2.2f%s\n", snapshot.get75thPercentile(), durationUnit);
   stream.printf(
       locale, "              95%% <= %2.2f%s\n", snapshot.get95thPercentile(), durationUnit);
   stream.printf(
       locale, "              98%% <= %2.2f%s\n", snapshot.get98thPercentile(), durationUnit);
   stream.printf(
       locale, "              99%% <= %2.2f%s\n", snapshot.get99thPercentile(), durationUnit);
   stream.printf(
       locale, "            99.9%% <= %2.2f%s\n", snapshot.get999thPercentile(), durationUnit);
 }