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

Method Less

model/value.go:318–329  ·  view source on GitHub ↗

Less compares first the metrics, then the timestamp.

(i, j int)

Source from the content-addressed store, hash-verified

316
317// Less compares first the metrics, then the timestamp.
318func (vec Vector) Less(i, j int) bool {
319 switch {
320 case vec[i].Metric.Before(vec[j].Metric):
321 return true
322 case vec[j].Metric.Before(vec[i].Metric):
323 return false
324 case vec[i].Timestamp.Before(vec[j].Timestamp):
325 return true
326 default:
327 return false
328 }
329}
330
331// Equal compares two sets of samples and returns true if they are equal.
332func (vec Vector) Equal(o Vector) bool {

Callers

nothing calls this directly

Calls 1

BeforeMethod · 0.45

Tested by

no test coverage detected