1 files changed,
24 insertions(+),
0 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-09-05 21:17:03 +0300
Authored at:
2026-09-05 20:36:50 +0300
Change ID:
zutkwluwnnyoxkwxqwnywvnxznrqkzon
Parent:
3143815
A
internal/cli/pprof_debug.go
ยทยทยท 1 +//go:build debug 2 + 3 +package cli 4 + 5 +import ( 6 + "fmt" 7 + "net/http" 8 + "os" 9 + 10 + _ "net/http/pprof" 11 +) 12 + 13 +func init() { 14 + addr := os.Getenv("CLERK_PPROF") 15 + if addr == "" { 16 + addr = "localhost:6969" 17 + } 18 + go func() { 19 + fmt.Printf("pprof: http://%s/debug/pprof\n", addr) 20 + if err := http.ListenAndServe(addr, nil); err != nil { 21 + fmt.Fprintf(os.Stderr, "pprof: %v\n", err) 22 + } 23 + }() 24 +}