@Override
    protected void update(Sample sample, MetricConfig config, double value, long timeMs) {
        final double boundedValue;
        if (value > max) {
            log.debug("Received value {} which is greater than max recordable value {}, will be pinned to the max value",
                     value, max);
            boundedValue = max;
        } else if (value < min) {
            log.debug("Received value {} which is less than min recordable value {}, will be pinned to the min value",
                     value, min);
            boundedValue = min;
        } else {
            boundedValue = value;
        }

        HistogramSample hist = (HistogramSample) sample;
        hist.histogram.record(boundedValue);
    }
A compound stat that reports one or more percentiles
clients/src/main/java/org/apache/kafka/common/metrics/stats/Percentiles.java