Prechádzať zdrojové kódy

use /debug/metrics as endpoint, seems more proper/elegant

Dieter Plaetinck 10 rokov pred
rodič
commit
7da7ed5778
2 zmenil súbory, kde vykonal 4 pridanie a 4 odobranie
  1. 2 2
      README.md
  2. 2 2
      exp/exp.go

+ 2 - 2
README.md

@@ -90,10 +90,10 @@ import "github.com/rcrowley/go-metrics/stathat"
 go stathat.Stathat(metrics.DefaultRegistry, 10e9, "example@example.com")
 ```
 
-Maintain all metrics along with expvars at `/debug/vars2`:
+Maintain all metrics along with expvars at `/debug/metrics`:
 
 This uses the same mechanism as [the official expvar](http://golang.org/pkg/expvar/)
-but exposed under `/debug/vars2`, which shows a json representation of all your usual expvars
+but exposed under `/debug/metrics`, which shows a json representation of all your usual expvars
 as well as all your go-metrics.
 
 

+ 2 - 2
exp/exp.go

@@ -1,5 +1,5 @@
 // Hook go-metrics into expvar
-// on any /debug/vars2 request, load all vars from the registry into expvar, and execute regular expvar handler
+// on any /debug/metrics request, load all vars from the registry into expvar, and execute regular expvar handler
 package exp
 
 import (
@@ -39,7 +39,7 @@ func Exp(r metrics.Registry) {
 	// panic: http: multiple registrations for /debug/vars
 	// http.HandleFunc("/debug/vars", e.expHandler)
 	// haven't found an elegant way, so just use a different endpoint
-	http.HandleFunc("/debug/vars2", e.expHandler)
+	http.HandleFunc("/debug/metrics", e.expHandler)
 }
 
 func (exp *exp) getInt(name string) *expvar.Int {