Merge pull request #77 from VictoriaMetrics/fixed-histogram-merge
fixed histogram merge
This commit is contained in:
commit
32321d68e1
@ -130,7 +130,7 @@ func (h *Histogram) Merge(b *Histogram) {
|
|||||||
h.decimalBuckets[i] = &b
|
h.decimalBuckets[i] = &b
|
||||||
}
|
}
|
||||||
for j := range db {
|
for j := range db {
|
||||||
h.decimalBuckets[i][j] = db[j]
|
h.decimalBuckets[i][j] += db[j]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ func TestHistogramMerge(t *testing.T) {
|
|||||||
|
|
||||||
b := NewHistogram("test")
|
b := NewHistogram("test")
|
||||||
for i := 98; i < 218; i++ {
|
for i := 98; i < 218; i++ {
|
||||||
h.Update(float64(i))
|
b.Update(float64(i))
|
||||||
}
|
}
|
||||||
|
|
||||||
h.Merge(b)
|
h.Merge(b)
|
||||||
|
Loading…
Reference in New Issue
Block a user