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

Function dataPointGreaterThan

pkg/traceql/series_heap.go:41–47  ·  view source on GitHub ↗

dataPointGreaterThan returns true if the new value should replace the smallest in a topk heap. This happens when the new value is greater, or equal but alphabetically earlier.

(a, b seriesValue)

Source from the content-addressed store, hash-verified

39// dataPointGreaterThan returns true if the new value should replace the smallest in a topk heap.
40// This happens when the new value is greater, or equal but alphabetically earlier.
41func dataPointGreaterThan(a, b seriesValue) bool {
42 if a.value == b.value {
43 return compareSeriesMapKey(a.key, b.key) > 0
44 }
45
46 return a.value > b.value
47}
48
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.

Callers 3

processTopKFunction · 0.85
TestDataPointGreaterThanFunction · 0.85
LessMethod · 0.85

Calls 1

compareSeriesMapKeyFunction · 0.85

Tested by 1

TestDataPointGreaterThanFunction · 0.68