commented out pprof while auth is in place
This commit is contained in:
+12
-11
@@ -5,7 +5,7 @@ import (
|
||||
"github.com/shuffle/shuffle-shared"
|
||||
singul "github.com/shuffle/singul/pkg"
|
||||
|
||||
"net/http/pprof"
|
||||
//"net/http/pprof"
|
||||
|
||||
"archive/zip"
|
||||
"bufio"
|
||||
@@ -5703,16 +5703,17 @@ func initHandlers() {
|
||||
r.HandleFunc("/api/v1/dashboards/{key}/widgets", shuffle.HandleNewWidget).Methods("POST", "OPTIONS")
|
||||
r.HandleFunc("/api/v1/dashboards/{key}/widgets/{widget_id}", shuffle.HandleGetWidget).Methods("GET", "OPTIONS")
|
||||
|
||||
if strings.ToLower(os.Getenv("SHUFFLE_DEBUG_MEMORY")) == "true" || strings.ToLower(os.Getenv("DEBUG_MEMORY")) == "true" {
|
||||
log.Printf("[DEBUG] Memory debugging is enabled on /debug/pprof")
|
||||
r.HandleFunc("/debug/pprof/", pprof.Index)
|
||||
r.HandleFunc("/debug/pprof/heap", pprof.Handler("heap").ServeHTTP)
|
||||
r.HandleFunc("/debug/pprof/profile", pprof.Profile)
|
||||
r.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
|
||||
r.HandleFunc("/debug/pprof/trace", pprof.Trace)
|
||||
} else {
|
||||
log.Printf("[DEBUG] Memory debugging is disabled. To enable, set SHUFFLE_DEBUG_MEMORY or DEBUG_MEMORY to true")
|
||||
}
|
||||
// Need to add auth in pprof
|
||||
// if strings.ToLower(os.Getenv("SHUFFLE_DEBUG_MEMORY")) == "true" || strings.ToLower(os.Getenv("DEBUG_MEMORY")) == "true" {
|
||||
// log.Printf("[DEBUG] Memory debugging is enabled on /debug/pprof")
|
||||
// r.HandleFunc("/debug/pprof/", pprof.Index)
|
||||
// r.HandleFunc("/debug/pprof/heap", pprof.Handler("heap").ServeHTTP)
|
||||
// r.HandleFunc("/debug/pprof/profile", pprof.Profile)
|
||||
// r.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
|
||||
// r.HandleFunc("/debug/pprof/trace", pprof.Trace)
|
||||
// } else {
|
||||
// log.Printf("[DEBUG] Memory debugging is disabled. To enable, set SHUFFLE_DEBUG_MEMORY or DEBUG_MEMORY to true")
|
||||
// }
|
||||
|
||||
r.Use(shuffle.RequestMiddleware)
|
||||
http.Handle("/", r)
|
||||
|
||||
Reference in New Issue
Block a user