Skip to content

Commit

Permalink
enable block and mutex profiling in pprof (#6)
Browse files Browse the repository at this point in the history
Co-authored-by: andyzhang2023 <[email protected]>
  • Loading branch information
andyzhang2023 and andyzhang2023 authored Oct 14, 2024
1 parent b0118f5 commit 3fb2ae8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/debug/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ func StartPProf(address string, withMetrics bool) {
exp.Exp(metrics.DefaultRegistry)
}
http.Handle("/memsize/", http.StripPrefix("/memsize", &Memsize))
runtime.SetBlockProfileRate(1)
runtime.SetMutexProfileFraction(1)
log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address))
go func() {
if err := http.ListenAndServe(address, nil); err != nil {
Expand Down

0 comments on commit 3fb2ae8

Please sign in to comment.