mirror of
https://github.com/prometheus/node_exporter
synced 2024-12-28 00:52:07 +00:00
Merge pull request #69 from matthiasr/sort-collector-names
Sort collector names.
This commit is contained in:
commit
4c6b8ec93b
@ -9,6 +9,7 @@ import (
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
@ -142,8 +143,13 @@ func main() {
|
||||
flag.Parse()
|
||||
|
||||
if *printCollectors {
|
||||
fmt.Printf("Available collectors:\n")
|
||||
collectorNames := make(sort.StringSlice, 0, len(collector.Factories))
|
||||
for n, _ := range collector.Factories {
|
||||
collectorNames = append(collectorNames, n)
|
||||
}
|
||||
collectorNames.Sort()
|
||||
fmt.Printf("Available collectors:\n")
|
||||
for _, n := range collectorNames {
|
||||
fmt.Printf(" - %s\n", n)
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user