Skip to content

Commit

Permalink
Display profiling address
Browse files Browse the repository at this point in the history
  • Loading branch information
olegbespalov committed Nov 8, 2023
1 parent 66dc9c5 commit 2089d5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ func (c *cmdRun) run(cmd *cobra.Command, args []string) (err error) {
go func() {
defer apiWG.Done()
logger.Debugf("Starting the REST API server on %s", c.gs.Flags.Address)
logger.Debugf("Profiling endpoints exposed: %v", c.gs.Flags.ProfilingEnabled)
if aerr := srv.ListenAndServe(); aerr != nil && !errors.Is(aerr, http.ErrServerClosed) {
// Only exit k6 if the user has explicitly set the REST API address
if cmd.Flags().Lookup("address").Changed {
Expand Down
4 changes: 4 additions & 0 deletions cmd/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ func printExecutionDescription(
}

fmt.Fprintf(buf, " output: %s\n", valueColor.Sprint(strings.Join(outputDescriptions, ", ")))
if gs.Flags.ProfilingEnabled && gs.Flags.Address != "" {
fmt.Fprintf(buf, " profiling: %s\n", valueColor.Sprintf("http://%s/debug/pprof/", gs.Flags.Address))
}

fmt.Fprintf(buf, "\n")

maxDuration, _ := lib.GetEndOffset(execPlan)
Expand Down

0 comments on commit 2089d5b

Please sign in to comment.