Skip to content

Commit e3074da

Browse files
committed
booster-http: add pprof-port flag
1 parent 2ef9489 commit e3074da

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmd/booster-http/run.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ var runCmd = &cli.Command{
5050
Name: "pprof",
5151
Usage: "run pprof web server on localhost:6070",
5252
},
53+
&cli.UintFlag{
54+
Name: "pprof-port",
55+
Usage: "the http port to serve pprof on",
56+
Value: 6070,
57+
},
5358
&cli.StringFlag{
5459
Name: "base-path",
5560
Usage: "the base path at which to run the web server",
@@ -178,8 +183,9 @@ var runCmd = &cli.Command{
178183
}
179184

180185
if cctx.Bool("pprof") {
186+
pprofPort := cctx.Int("pprof-port")
181187
go func() {
182-
err := http.ListenAndServe("localhost:6070", nil)
188+
err := http.ListenAndServe(fmt.Sprintf("localhost:%d", pprofPort), nil)
183189
if err != nil {
184190
log.Error(err)
185191
}

0 commit comments

Comments
 (0)