Skip to content

Commit

Permalink
Make correct maps when merging
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Dec 18, 2024
1 parent 2c8d1ef commit 7b80a8e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,13 @@ func (m *RuntimeMetrics) Merge(other *RuntimeMetrics) {
return
}
if m.UintMetrics == nil {
m.UintMetrics = make(map[string]uint64)
m.UintMetrics = make(map[string]uint64, len(other.UintMetrics))
}
if m.FloatMetrics == nil {
m.UintMetrics = make(map[string]uint64)
m.FloatMetrics = make(map[string]float64, len(other.FloatMetrics))
}
if m.FloatMetrics == nil {
m.UintMetrics = make(map[string]uint64)
if m.HistMetrics == nil {
m.HistMetrics = make(map[string]metrics.Float64Histogram, len(other.HistMetrics))
}
for k, v := range other.UintMetrics {
m.UintMetrics[k] += v
Expand Down

0 comments on commit 7b80a8e

Please sign in to comment.