diff --git a/main.go b/main.go index e022a7864ab86f8db27f01b52872b62d0f2bcb10..79d71a860d7ce3f4dd159003f18ad4fab57f8dc9 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "embed" "log" "net/http" + "net/http/pprof" "github.com/dgraph-io/badger/v3" flag "github.com/spf13/pflag" @@ -63,6 +64,11 @@ func main() { mux.HandleFunc("/read", m.readHandler) mux.HandleFunc("/delete", m.deleteHandler) mux.HandleFunc("/update", m.updateHandler) + mux.HandleFunc("/debug/pprof", pprof.Index) + mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) + mux.HandleFunc("/debug/pprof/profile", pprof.Profile) + mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) + mux.HandleFunc("/debug/pprof/trace", pprof.Trace) if err = httpServer.ListenAndServe(); err == http.ErrServerClosed { log.Println("Web server closed")