diff options
Diffstat (limited to 'plugin/pprof/pprof.go')
-rw-r--r-- | plugin/pprof/pprof.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugin/pprof/pprof.go b/plugin/pprof/pprof.go index 6cfaa5490..8367a3071 100644 --- a/plugin/pprof/pprof.go +++ b/plugin/pprof/pprof.go @@ -6,12 +6,14 @@ import ( "net" "net/http" pp "net/http/pprof" + "runtime" ) type handler struct { - addr string - ln net.Listener - mux *http.ServeMux + addr string + rateBloc int + ln net.Listener + mux *http.ServeMux } func (h *handler) Startup() error { @@ -30,6 +32,8 @@ func (h *handler) Startup() error { h.mux.HandleFunc(path+"/symbol", pp.Symbol) h.mux.HandleFunc(path+"/trace", pp.Trace) + runtime.SetBlockProfileRate(h.rateBloc) + go func() { http.Serve(h.ln, h.mux) }() |