Skip to content
Prev Previous commit
Next Next commit
Add todo
  • Loading branch information
jeschkies committed Dec 17, 2024
commit dc5dacd85805b43833268adf635b3f4e92528964
2 changes: 1 addition & 1 deletion pkg/logql/count_min_sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func (v *HeapCountMinSketchVector) Add(metric labels.Labels, value float64) {
heap.Push(v, metric)
v.observed[metricString] = struct{}{}
} else if v.Metrics[0].String() == metricString {
// TODO: This check seems wrong.
// The smalles element has been updated to fix the heap.
heap.Fix(v, 0)
}
Expand All @@ -197,7 +198,6 @@ func (v *HeapCountMinSketchVector) Add(metric labels.Labels, value float64) {
if len(v.Metrics) > v.maxLabels {
metric := heap.Pop(v).(labels.Labels)
delete(v.observed, metric.String())
v.Metrics = v.Metrics[1:]
}
}

Expand Down
Loading