Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package io.tehuti.metrics.stats;
 import java.util.List;

A SampledStat that maintains a total of what it has seen. Generally useless on its own, but useful as an intermediate result for other metrics, such as a Rate.
public class SampledTotal extends SampledStat {
    public SampledTotal() {
    protected void update(Sample sampleMetricConfig configdouble valuelong timeMs) {
        sample.value += value;
    public double combine(List<SamplesamplesMetricConfig configlong now) {
        double total = 0.0;
        for (int i = 0; i < samples.size(); i++)
            total += samples.get(i).;
        return total;
New to GrepCode? Check out our FAQ X