summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2020-06-18 16:46:56 -0500
committerSean E. Russell <ser@ser1.net>2020-06-18 16:46:56 -0500
commitb29c2b1c89b9eb64f08ae005853d5e8047bdd432 (patch)
tree60b761f4f65c9c7ebb1fdf079038087cd0c20849 /cmd
parent444d2624ab6d5b054446a08ad6888126f9d3494c (diff)
parente2879e970c09d01422d6bc259d2601572679f745 (diff)
Merge branch 'master' into i18n
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotop/main.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go
index d1cffaa..da4ee41 100644
--- a/cmd/gotop/main.go
+++ b/cmd/gotop/main.go
@@ -18,9 +18,9 @@ import (
//_ "net/http/pprof"
+ "github.com/VictoriaMetrics/metrics"
jj "github.com/cloudfoundry-attic/jibber_jabber"
ui "github.com/gizak/termui/v3"
- "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/shibukawa/configdir"
"github.com/xxxserxxx/lingo"
"github.com/xxxserxxx/opflag"
@@ -446,9 +446,12 @@ func run() int {
ui.Render(bar)
}
+ // TODO https://godoc.org/github.com/VictoriaMetrics/metrics#Set
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)
}()
}
@@ -488,7 +491,7 @@ func getLayout(conf gotop.Config) (io.Reader, error) {
}
}
-func runTests(conf gotop.Config) int {
+func runTests(_ gotop.Config) int {
fmt.Printf("PASS")
return 0
}