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.
21 lines
432 B
Go
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)
|
|
}
|
|
}
|