Custom ServeMux and pprof

48 views
Skip to first unread message

st ov

unread,
Aug 28, 2017, 3:31:12 PM8/28/17
to golang-nuts
How do you add pprof to a custom ServeMux?

https://golang.org/pkg/net/http/#ServeMux

Its my understanding that the following import only adds handlers to the default mux.

import _ "net/http/pprof"


Konstantin Khomoutov

unread,
Aug 28, 2017, 4:57:03 PM8/28/17
to st ov, golang-nuts

Dave Cheney

unread,
Aug 28, 2017, 6:08:49 PM8/28/17
to golang-nuts
Copy lines 72-76 into your project. https://golang.org/src/net/http/pprof/pprof.go#L72
Reply all
Reply to author
Forward
0 new messages