mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
Pprof listen (#639)
* add listen addr option * Add listen address option to pprof * There is configuration * code styling
This commit is contained in:
committed by
John Belamaric
parent
4c9351b0a3
commit
f359aea2fa
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user