Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Implement pprof support #82

Merged
merged 1 commit into from
Jun 4, 2018
Merged

Implement pprof support #82

merged 1 commit into from
Jun 4, 2018

Conversation

mjs
Copy link
Contributor

@mjs mjs commented May 29, 2018

Instead of having pprof support hardcoded into just the writer, allow the port to be specified via the configuration.

@mjs mjs requested a review from oplehto May 29, 2018 00:35
@mjs
Copy link
Contributor Author

mjs commented May 29, 2018

Tests are failing because the fixes for #81 are needed here too. Once they've landed I'll rebase this PR and ensure the tests pass.

@mjs mjs requested a review from amnonbc May 29, 2018 04:03
cmd/run.go Outdated
if c.PprofPort > 0 {
go func() {
log.Printf("starting pprof listener on port %d", c.PprofPort)
http.ListenAndServe(fmt.Sprintf(":%d", c.PprofPort), nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth printing out the error message returned by ListenAndServer. There may be another application already listening on PprofPort

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Doing that now.

Instead of having pprof support hardcoded into just the writer, allow
the port to be specified via the configuration.
@mjs mjs merged commit 9bec111 into jumptrading:master Jun 4, 2018
@mjs mjs deleted the pprof-support branch June 4, 2018 21:29
go func() {
log.Printf("starting pprof listener on port %d", c.PprofPort)
err := http.ListenAndServe(fmt.Sprintf(":%d", c.PprofPort), nil)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http.ListenAndServe will only return if err is non-nil
So the if is unnecessary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants