Skip to content

Commit

Permalink
Merge pull request #5 from nodece/main
Browse files Browse the repository at this point in the history
fix: add pprof
  • Loading branch information
nodece authored Mar 2, 2021
2 parents ac368bd + a8062a0 commit f14a718
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions http/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io/ioutil"
"net"
"net/http"
"net/http/pprof"
"strings"
"time"

Expand Down Expand Up @@ -102,6 +103,13 @@ func NewService(ln net.Listener, tlsConfig *tls.Config, store Store) (*Service,
r.Put("/remove", s.handleRemoveNode)
})

// add pprof
r.HandleFunc("/debug/pprof/", pprof.Index)
r.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
r.HandleFunc("/debug/pprof/profile", pprof.Profile)
r.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
r.HandleFunc("/debug/pprof/trace", pprof.Trace)

s.srv = &http.Server{
Handler: r,
ReadHeaderTimeout: 10 * time.Second,
Expand Down

0 comments on commit f14a718

Please sign in to comment.