Skip to content

Commit d5c127b

Browse files
committed
Add pprof for debug
1 parent f4ecdaf commit d5c127b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/inbound/server.go

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"io"
88
"net"
99
"net/http"
10+
"net/http/pprof"
1011
"os"
1112
"strconv"
1213
"strings"
@@ -130,6 +131,11 @@ func (s *Server) Run() {
130131

131132
if s.debugHttpAddress != "" {
132133
s.HTTPMux.HandleFunc("/cache", s.DumpCache)
134+
s.HTTPMux.HandleFunc("/debug/pprof/", pprof.Index)
135+
s.HTTPMux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
136+
s.HTTPMux.HandleFunc("/debug/pprof/profile", pprof.Profile)
137+
s.HTTPMux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
138+
s.HTTPMux.HandleFunc("/debug/pprof/trace", pprof.Trace)
133139

134140
wg.Add(1)
135141
go func() {

0 commit comments

Comments
 (0)