MCPcopy
hub / github.com/grafana/tempo / dataPointLessThan

Function dataPointLessThan

pkg/traceql/series_heap.go:51–57  ·  view source on GitHub ↗

dataPointLessThan returns true if the new value should replace the largest in a bottomk heap. This happens when the new value is smaller, or equal but alphabetically earlier.

(a, b seriesValue)

Source from the content-addressed store, hash-verified

49// dataPointLessThan returns true if the new value should replace the largest in a bottomk heap.
50// This happens when the new value is smaller, or equal but alphabetically earlier.
51func dataPointLessThan(a, b seriesValue) bool {
52 if a.value == b.value {
53 return compareSeriesMapKey(a.key, b.key) < 0
54 }
55
56 return a.value < b.value
57}
58
59// seriesHeap implements a min-heap of seriesValue
60type seriesHeap []seriesValue

Callers 3

processBottomKFunction · 0.85
TestDataPointLessThanFunction · 0.85
LessMethod · 0.85

Calls 1

compareSeriesMapKeyFunction · 0.85

Tested by 1

TestDataPointLessThanFunction · 0.68