summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2020-05-24 14:38:14 -0500
committerSean E. Russell <ser@ser1.net>2020-05-24 14:38:14 -0500
commitd7773a87b86a75c2bc6fa9912d376bc89ce4fa34 (patch)
tree12be3fe3570ece6be263e04ba0dd5609bdf44850 /cmd
parentc05b3478ca5ab4043372b9028ebc7499372bf1e9 (diff)
parent9fd6764acfa81be0b28458fd62844ad341c96740 (diff)
Merge branch 'master' into v4.0
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotop/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go
index bd00b66..040c8b2 100644
--- a/cmd/gotop/main.go
+++ b/cmd/gotop/main.go
@@ -17,8 +17,8 @@ import (
//_ "net/http/pprof"
+ "github.com/VictoriaMetrics/metrics"
ui "github.com/gizak/termui/v3"
- "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/shibukawa/configdir"
"github.com/xxxserxxx/opflag"
@@ -72,8 +72,6 @@ func parseArgs() error {
opflag.StringVarP(&conf.NetInterface, "interface", "i", "all", "Select network interface. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using `!`")
opflag.StringVarP(&conf.ExportPort, "export", "x", conf.ExportPort, "Enable metrics for export on the specified port.")
opflag.BoolVarP(&conf.Mbps, "mbps", "", conf.Mbps, "Show network rate as mbps.")
- // FIXME Where did this go??
- //conf.Band = opflag.IntP("bandwidth", "B", 100, "Specify the number of bits per seconds.")
opflag.BoolVar(&conf.Test, "test", conf.Test, "Runs tests and exits with success/failure code.")
opflag.StringP("", "C", "", "Config file to use instead of default (MUST BE FIRST ARGUMENT)")
list := opflag.String("list", "", `List <devices|layouts|colorschemes|paths|keys>
@@ -437,7 +435,9 @@ func run() int {
if conf.ExportPort != "" {
go func() {
- http.Handle("/metrics", promhttp.Handler())
+ http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
+ metrics.WritePrometheus(w, true)
+ })
http.ListenAndServe(conf.ExportPort, nil)
}()
}