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 simple count 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 SampledCount extends SampledStat {
    public SampledCount() {
    protected void update(Sample sampleMetricConfig configdouble valuelong now) {
        sample.value += 1.0;
    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