summaryrefslogtreecommitdiff
path: root/internal/statsengine/histogram.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-20 11:38:19 +0300
committerPaul Buetow <paul@buetow.org>2026-05-20 11:38:19 +0300
commit9310b54d439d4a1a8d4d337987aa63884df0af76 (patch)
treec6fb38085891a04ce81672f977af316a2e96b2fd /internal/statsengine/histogram.go
parent5fd613562e2aa2ab3aac3349f44db88330046c1c (diff)
feat: add syscall aggregate sampling infrastructure (task 17)
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 {