From e1640cc72fe9e4fcde840bc5471f9051751b5770 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Thu, 18 May 2017 11:21:24 -0700 Subject: [PATCH] etcd-tester: use 'debugutil.PProfHandlers' Signed-off-by: Gyu-Ho Lee --- tools/functional-tester/etcd-tester/main.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/functional-tester/etcd-tester/main.go b/tools/functional-tester/etcd-tester/main.go index fd72a30fa..9c44ac24e 100644 --- a/tools/functional-tester/etcd-tester/main.go +++ b/tools/functional-tester/etcd-tester/main.go @@ -18,10 +18,11 @@ import ( "flag" "fmt" "net/http" - "net/http/pprof" "os" "strings" + "github.com/coreos/etcd/pkg/debugutil" + "github.com/coreos/pkg/capnslog" "github.com/prometheus/client_golang/prometheus" "golang.org/x/time/rate" @@ -138,15 +139,9 @@ func main() { http.Handle("/metrics", prometheus.Handler()) if *enablePprof { - http.Handle(pprofPrefix+"/", http.HandlerFunc(pprof.Index)) - http.Handle(pprofPrefix+"/profile", http.HandlerFunc(pprof.Profile)) - http.Handle(pprofPrefix+"/symbol", http.HandlerFunc(pprof.Symbol)) - http.Handle(pprofPrefix+"/cmdline", http.HandlerFunc(pprof.Cmdline)) - http.Handle(pprofPrefix+"/trace", http.HandlerFunc(pprof.Trace)) - http.Handle(pprofPrefix+"/heap", pprof.Handler("heap")) - http.Handle(pprofPrefix+"/goroutine", pprof.Handler("goroutine")) - http.Handle(pprofPrefix+"/threadcreate", pprof.Handler("threadcreate")) - http.Handle(pprofPrefix+"/block", pprof.Handler("block")) + for p, h := range debugutil.PProfHandlers() { + http.Handle(p, h) + } } go func() { plog.Fatal(http.ListenAndServe(":9028", nil)) }()