mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(monitor,webconsole): enable app profiling (#22176)
This commit is contained in:
@@ -31,6 +31,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
|
||||
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
|
||||
"yunion.io/x/onecloud/pkg/monitor/models"
|
||||
"yunion.io/x/onecloud/pkg/monitor/options"
|
||||
)
|
||||
|
||||
func InitHandlers(app *appsrv.Application) {
|
||||
@@ -134,5 +135,7 @@ func addMiscHandlers(app *appsrv.Application, root *mux.Router) {
|
||||
root.HandleFunc("/worker_stats", adapterF(appsrv.WorkerStatsHandler))
|
||||
|
||||
// pprof handler
|
||||
root.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
|
||||
if options.Options.EnableAppProfiling {
|
||||
root.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,5 +141,7 @@ func addMiscHandlers(app *appsrv.Application, root *mux.Router) {
|
||||
root.HandleFunc("/worker_stats", adapterF(appsrv.WorkerStatsHandler))
|
||||
|
||||
// pprof handler
|
||||
root.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
|
||||
if o.Options.EnableAppProfiling {
|
||||
root.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user