public void updateSnapshotRangeMetrics(MetricsRecordBuilder metricsRecordBuilder,
    Snapshot snapshot) {
    long priorRange = 0;
    long cumNum = 0;

    final long[] ranges = getRanges();
    final String rangeType = getRangeType();
    for (int i = 0; i < ranges.length; i++) {
      long val = snapshot.getCountAtOrBelow(ranges[i]);
      if (val - cumNum > 0) {
        metricsRecordBuilder.addCounter(
          Interns.info(name + "_" + rangeType + "_" + priorRange + "-" + ranges[i], desc),
          val - cumNum);
      }
      priorRange = ranges[i];
      cumNum = val;
    }
    long val = snapshot.getCount();
    if (val - cumNum > 0) {
      metricsRecordBuilder.addCounter(
        Interns.info(name + "_" + rangeType + "_" + priorRange + "-inf", desc), val - cumNum);
    }
  }
Returns the ranges to be counted
hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableRangeHistogram.java