@Override
    public double combine(List<Sample> samples, MetricConfig config, long now) {
        double total = 0.0;
        for (Sample sample : samples)
            total += sample.value;
        return total;
    }
A {@link SampledStat} that maintains the sum of what it has seen.
This is a sampled version of {@link CumulativeSum}.

See also {@link WindowedCount} if you want to increment the value by 1 on each recording.
clients/src/main/java/org/apache/kafka/common/metrics/stats/WindowedSum.java