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] } } } 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)