MCPcopy Create free account
hub / github.com/prometheus/common / Less

Method Less

model/value.go:297–308  ·  view source on GitHub ↗

Less compares first the metrics, then the timestamp.

(i, j int)

Source from the content-addressed store, hash-verified

295
296// Less compares first the metrics, then the timestamp.
297func (vec Vector) Less(i, j int) bool {
298 switch {
299 case vec[i].Metric.Before(vec[j].Metric):
300 return true
301 case vec[j].Metric.Before(vec[i].Metric):
302 return false
303 case vec[i].Timestamp.Before(vec[j].Timestamp):
304 return true
305 default:
306 return false
307 }
308}
309
310// Equal compares two sets of samples and returns true if they are equal.
311func (vec Vector) Equal(o Vector) bool {

Callers

nothing calls this directly

Calls 1

BeforeMethod · 0.45

Tested by

no test coverage detected