mirror of
https://github.com/prometheus/prometheus
synced 2024-12-24 07:23:02 +00:00
Add sortable target list
This commit is contained in:
parent
2c931950c6
commit
ddc74f712b
@ -221,6 +221,13 @@ func (t *Target) Health() TargetHealth {
|
||||
return t.health
|
||||
}
|
||||
|
||||
// Targets is a sortable list of targets.
|
||||
type Targets []*Target
|
||||
|
||||
func (ts Targets) Len() int { return len(ts) }
|
||||
func (ts Targets) Less(i, j int) bool { return ts[i].URL().String() < ts[j].URL().String() }
|
||||
func (ts Targets) Swap(i, j int) { ts[i], ts[j] = ts[j], ts[i] }
|
||||
|
||||
// Merges the ingested sample's metric with the label set. On a collision the
|
||||
// value of the ingested label is stored in a label prefixed with 'exported_'.
|
||||
type ruleLabelsAppender struct {
|
||||
|
Loading…
Reference in New Issue
Block a user