We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f416544 commit 18ee386Copy full SHA for 18ee386
debug/pprof.go
@@ -28,7 +28,9 @@ func RunDebug(name string) {
28
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
29
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
30
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
31
-
+ for path, handler := range appendHandler {
32
+ mux.HandleFunc(path, handler)
33
+ }
34
lAddr := listen.Addr().(*net.TCPAddr)
35
36
log.Infof("start pprof:\thttp%s:%d", lAddr.IP.String(), lAddr.Port)
@@ -44,3 +46,11 @@ func RunDebug(name string) {
44
46
}()
45
47
48
}
49
+
50
+var (
51
+ appendHandler = map[string]func(w http.ResponseWriter, r *http.Request){}
52
+)
53
54
+func Register(s string, handler func(w http.ResponseWriter, r *http.Request)) {
55
+ appendHandler[s] = handler
56
+}
0 commit comments