summaryrefslogtreecommitdiff
path: root/internal/statsengine/histogram.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/statsengine/histogram.go')
-rw-r--r--internal/statsengine/histogram.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/statsengine/histogram.go b/internal/statsengine/histogram.go
index 4a5e3b4..27d3285 100644
--- a/internal/statsengine/histogram.go
+++ b/internal/statsengine/histogram.go
@@ -47,6 +47,16 @@ func (h *histogram) Increment(durationNs uint64) {
h.total++
}
+func (h *histogram) AddBucketCounts(counts [histogramBucketCount]uint64) {
+ if h == nil {
+ return
+ }
+ for i, count := range counts {
+ h.counts[i] += count
+ h.total += count
+ }
+}
+
// Snapshot returns a HistogramSnapshot of the current histogram state.
// It panics on build error, which should never happen for a valid histogram.
func (h *histogram) Snapshot() HistogramSnapshot {