public static void snapshot(String name, String desc, Histogram histogram,
    MetricsRecordBuilder metricsRecordBuilder, boolean all) {
    // Get a reference to the old histogram.
    Snapshot snapshot = histogram.snapshot();
    if (snapshot != null) {
      updateSnapshotMetrics(name, desc, histogram, snapshot, metricsRecordBuilder);
    }
  }
A histogram implementation that runs in constant space, and exports to hadoop2's metrics2 system.
hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableHistogram.java