From 925f863c7bd0070c7566608751b2290b693dfb94 Mon Sep 17 00:00:00 2001 From: AndrewChubatiuk Date: Tue, 9 Jul 2024 11:04:36 +0300 Subject: [PATCH 1/2] fixed histogram merge --- histogram.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/histogram.go b/histogram.go index 0d953d5..ccb63d9 100644 --- a/histogram.go +++ b/histogram.go @@ -130,7 +130,7 @@ func (h *Histogram) Merge(b *Histogram) { h.decimalBuckets[i] = &b } for j := range db { - h.decimalBuckets[i][j] = db[j] + h.decimalBuckets[i][j] += db[j] } } } From 001417b6f1aaf4c1f6e612c3c9a67c0cbdc7d36f Mon Sep 17 00:00:00 2001 From: AndrewChubatiuk Date: Wed, 10 Jul 2024 13:30:47 +0300 Subject: [PATCH 2/2] fixed tests --- histogram_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/histogram_test.go b/histogram_test.go index 37b1616..a1f2e2e 100644 --- a/histogram_test.go +++ b/histogram_test.go @@ -20,7 +20,7 @@ func TestHistogramMerge(t *testing.T) { b := NewHistogram("test") for i := 98; i < 218; i++ { - h.Update(float64(i)) + b.Update(float64(i)) } h.Merge(b)