Skip to content

Commit

Permalink
Add in support for the other /debug/pprof URLs into ProxyFS's & PFSAg…
Browse files Browse the repository at this point in the history
…ent's embedded HTTP Servers
  • Loading branch information
Ed McClanahan committed Jul 10, 2020
1 parent ed04151 commit a8a435f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions httpserver/request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ func doGet(responseWriter http.ResponseWriter, request *http.Request) {
doGetOfMetrics(responseWriter, request)
case "/stats" == path:
doGetOfStats(responseWriter, request)
case "/debug/pprof" == path:
pprof.Index(responseWriter, request)
case "/debug/pprof/cmdline" == path:
pprof.Cmdline(responseWriter, request)
case "/debug/pprof/profile" == path:
Expand All @@ -167,6 +165,8 @@ func doGet(responseWriter http.ResponseWriter, request *http.Request) {
pprof.Symbol(responseWriter, request)
case "/debug/pprof/trace" == path:
pprof.Trace(responseWriter, request)
case strings.HasPrefix(request.URL.Path, "/debug/pprof"):
pprof.Index(responseWriter, request)
case "/open-iconic/font/css/open-iconic-bootstrap.min.css" == path:
responseWriter.Header().Set("Content-Type", openIconicBootstrapDotCSSContentType)
responseWriter.WriteHeader(http.StatusOK)
Expand Down
22 changes: 11 additions & 11 deletions pfsagentd/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,24 @@ func serveGet(responseWriter http.ResponseWriter, request *http.Request) {

path = strings.TrimRight(request.URL.Path, "/")

switch path {
case "/config":
switch {
case "/config" == path:
serveGetOfConfig(responseWriter, request)
case "/debug/pprof":
pprof.Index(responseWriter, request)
case "/debug/pprof/cmdline":
case "/debug/pprof/cmdline" == path:
pprof.Cmdline(responseWriter, request)
case "/debug/pprof/profile":
case "/debug/pprof/profile" == path:
pprof.Profile(responseWriter, request)
case "/debug/pprof/symbol":
case "/debug/pprof/symbol" == path:
pprof.Symbol(responseWriter, request)
case "/debug/pprof/trace":
case "/debug/pprof/trace" == path:
pprof.Trace(responseWriter, request)
case "/metrics":
case strings.HasPrefix(path, "/debug/pprof"):
pprof.Index(responseWriter, request)
case "/metrics" == path:
serveGetOfMetrics(responseWriter, request)
case "/stats":
case "/stats" == path:
serveGetOfStats(responseWriter, request)
case "/version":
case "/version" == path:
serveGetOfVersion(responseWriter, request)
default:
responseWriter.WriteHeader(http.StatusNotFound)
Expand Down

0 comments on commit a8a435f

Please sign in to comment.