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

Method Less

model/alert.go:110–118  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

108func (as Alerts) Swap(i, j int) { as[i], as[j] = as[j], as[i] }
109
110func (as Alerts) Less(i, j int) bool {
111 if as[i].StartsAt.Before(as[j].StartsAt) {
112 return true
113 }
114 if as[i].EndsAt.Before(as[j].EndsAt) {
115 return true
116 }
117 return as[i].Fingerprint() < as[j].Fingerprint()
118}
119
120// HasFiring returns true iff one of the alerts is not resolved.
121func (as Alerts) HasFiring() bool {

Callers

nothing calls this directly

Calls 2

BeforeMethod · 0.45
FingerprintMethod · 0.45

Tested by

no test coverage detected