|
|
@@ -14,6 +14,23 @@ import (
|
|
14
|
14
|
)
|
|
15
|
15
|
|
|
16
|
16
|
func main() {
|
|
|
17
|
+ // this runs profiling server. To enable it, build with prof tag
|
|
|
18
|
+ // $ go build -tags prof
|
|
|
19
|
+ //
|
|
|
20
|
+ // Then you can pass a port using MTG_PROF_PORT environment variable.
|
|
|
21
|
+ // Default is 6000
|
|
|
22
|
+ // $ MTG_PROF_PORT=6000 mtg run config.toml
|
|
|
23
|
+ //
|
|
|
24
|
+ // It will run a webserver with profiling data on
|
|
|
25
|
+ // localhost:${MTG_PROF_PORT:-6000}.
|
|
|
26
|
+ //
|
|
|
27
|
+ // To collect PGO do following:
|
|
|
28
|
+ // $ curl -o default.pgo 'http://localhost:6000/debug/pprof/profile?seconds=300'
|
|
|
29
|
+ //
|
|
|
30
|
+ // See also https://pkg.go.dev/net/http/pprof
|
|
|
31
|
+ // https://go.dev/blog/pprof
|
|
|
32
|
+ runProfile()
|
|
|
33
|
+
|
|
17
|
34
|
cli := &cli.CLI{}
|
|
18
|
35
|
ctx := kong.Parse(cli, kong.Vars{
|
|
19
|
36
|
"version": getVersion(),
|