tool: elektrad - remove profiler endpoint
@@ -4,14 +4,11 @@ import (
"encoding/json"
"net/http"
- "net/http/pprof"
-
"github.com/gorilla/mux"
)
func setupRouter(app *server) http.Handler {
r := mux.NewRouter()
- AttachProfiler(r)
r.Use(handleMiddleware(app.pool))
@@ -26,25 +23,15 @@ func setupRouter(app *server) http.Handler {
r.HandleFunc("/kdbMv/{path:.*}", app.postMoveHandler).Methods("POST")
+ // TODO
+ // r.HandleFunc("/kdbCp/{path:.*", app.postCopyHandler).Methods("POST")
+
r.HandleFunc("/kdbMeta/{path:.*}", app.postMetaHandler).Methods("POST")
r.HandleFunc("/kdbMeta/{path:.*}", app.deleteMetaHandler).Methods("DELETE")
return r
}
-func AttachProfiler(router *mux.Router) {
- router.HandleFunc("/debug/pprof/", pprof.Index)
- router.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
- router.HandleFunc("/debug/pprof/profile", pprof.Profile)
- router.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
-
- // Manually add support for paths linked to by index page at /debug/pprof/
- router.Handle("/debug/pprof/goroutine", pprof.Handler("goroutine"))
- router.Handle("/debug/pprof/heap", pprof.Handler("heap"))
- router.Handle("/debug/pprof/threadcreate", pprof.Handler("threadcreate"))
- router.Handle("/debug/pprof/block", pprof.Handler("block"))
-}
-
func parseKeyNameFromURL(r *http.Request) string {
vars := mux.Vars(r)
keyName := vars["path"]
