Pprof listen (#639)

* add listen addr option

* Add listen address option to pprof

* There is configuration

* code styling
This commit is contained in:
Chris O'Haver
2017-04-24 10:27:26 -04:00
committed by John Belamaric
parent 4c9351b0a3
commit f359aea2fa
4 changed files with 34 additions and 9 deletions

View File

@@ -10,12 +10,13 @@ import (
)
type handler struct {
ln net.Listener
mux *http.ServeMux
addr string
ln net.Listener
mux *http.ServeMux
}
func (h *handler) Startup() error {
ln, err := net.Listen("tcp", addr)
ln, err := net.Listen("tcp", h.addr)
if err != nil {
log.Printf("[ERROR] Failed to start pprof handler: %s", err)
return err
@@ -44,6 +45,5 @@ func (h *handler) Shutdown() error {
}
const (
addr = "localhost:6053"
path = "/debug/pprof"
)