@Override
    protected void update(Sample sample, MetricConfig config, double value, long now) {
        sample.value += value;
    }
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