Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public void setup() {
.putAll(histogramAttrs)
.build();
this.shouldRecord = level.isWithin(globalConfig.getMetricsLevel());
histogram.setSnapshotInterval(globalConfig.getMetricsReportIntervalMs());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
import org.HdrHistogram.Histogram;
import org.HdrHistogram.Recorder;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.LongAdder;
import java.util.function.BiPredicate;

public class DeltaHistogram {
private static final Long DEFAULT_SNAPSHOT_INTERVAL_MS = 5000L;
private static final Long DEFAULT_SNAPSHOT_INTERVAL_MS = TimeUnit.SECONDS.toMillis(30);
private final LongAdder cumulativeCount = new LongAdder();
private final LongAdder cumulativeSum = new LongAdder();
private final AtomicLong min = new AtomicLong(Long.MAX_VALUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public HistogramMetric(MetricsLevel currentMetricsLevel, MetricsConfig metricsCo
public HistogramMetric(MetricsLevel currentMetricsLevel, MetricsConfig metricsConfig, Attributes extraAttributes) {
super(metricsConfig, extraAttributes);
this.deltaHistogram = new DeltaHistogram();
this.deltaHistogram.setSnapshotInterval(metricsConfig.getMetricsReportIntervalMs());
this.currentMetricsLevel = currentMetricsLevel;
}

Expand Down
Loading