This commit is contained in:
9seconds
2026-03-20 10:54:30 +01:00
parent 9ba6df0d1c
commit 4fbabfda2a
5 changed files with 54 additions and 0 deletions
+17
View File
@@ -14,6 +14,23 @@ import (
)
func main() {
// this runs profiling server. To enable it, build with prof tag
// $ go build -tags prof
//
// Then you can pass a port using MTG_PROF_PORT environment variable.
// Default is 6000
// $ MTG_PROF_PORT=6000 mtg run config.toml
//
// It will run a webserver with profiling data on
// localhost:${MTG_PROF_PORT:-6000}.
//
// To collect PGO do following:
// $ curl -o default.pgo 'http://localhost:6000/debug/pprof/profile?seconds=300'
//
// See also https://pkg.go.dev/net/http/pprof
// https://go.dev/blog/pprof
runProfile()
cli := &cli.CLI{}
ctx := kong.Parse(cli, kong.Vars{
"version": getVersion(),