Files
next.orly.dev/pprof.go
mleku 110223fc4e Migrate internal module imports to unified package path.
Replaced legacy `*.orly` module imports with `next.orly.dev/pkg` paths across the codebase for consistency. Removed legacy `go.mod` files from sub-packages, consolidating dependency management. Added Dockerfiles and configurations for benchmarking environments.
2025-09-12 16:12:31 +01:00

21 lines
432 B
Go

package main
import (
"github.com/pkg/profile"
"next.orly.dev/pkg/utils/interrupt"
)
func startProfiler(mode string) {
switch mode {
case "cpu":
prof := profile.Start(profile.CPUProfile)
interrupt.AddHandler(prof.Stop)
case "memory":
prof := profile.Start(profile.MemProfile)
interrupt.AddHandler(prof.Stop)
case "allocation":
prof := profile.Start(profile.MemProfileAllocs)
interrupt.AddHandler(prof.Stop)
}
}