Skip to content

Commit

Permalink
test3
Browse files Browse the repository at this point in the history
  • Loading branch information
ying-zhu committed Aug 17, 2022
1 parent 7f106d3 commit 8e6a9b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pilot/cmd/pilot-agent/status/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"net"
"net/http"
"net/http/pprof"
_ "net/http/pprof"
"os"
"regexp"
"runtime"
Expand Down Expand Up @@ -330,10 +331,11 @@ func (s *Server) Run(ctx context.Context) {
// Add the handler for pprof.
runtime.SetBlockProfileRate(1)
runtime.SetMutexProfileFraction(1)
fmt.Println("[Ying] block rate and mutex fraction set to 1")

mux.HandleFunc("/debug/pprof/", s.handlePprofIndex)
mux.HandleFunc("/debug/pprof/", pprof.Index)
mux.HandleFunc("/debug/pprof/cmdline", s.handlePprofCmdline)
mux.HandleFunc("/debug/pprof/profile", s.handlePprofProfile)
mux.HandleFunc("/debug/pprof/profile", pprof.Handler("profile").ServeHTTP)
mux.HandleFunc("/debug/pprof/symbol", s.handlePprofSymbol)
mux.HandleFunc("/debug/pprof/trace", s.handlePprofTrace)
mux.HandleFunc("/debug/pprof/block", pprof.Handler("block").ServeHTTP)
Expand Down

0 comments on commit 8e6a9b7

Please sign in to comment.