-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added pprof tool #2512
Merged
Merged
Added pprof tool #2512
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
563ad9c
Added pprof tool
83bbe4a
gofmt fixes
aaf9032
Added help for pprof. Parameter pprofaddr renamed to pprof-addr.
9148a14
Added pprof addr to log. Updated CHANGELOG.md
d-ulyanov 5a095ab
Changed pprof log message
d-ulyanov 927f8b2
Merge branch 'master' into profiling
danielnelson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Telegraf profiling | ||
|
||
Telegraf uses the standard package `net/http/pprof`. This package serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool. | ||
|
||
By default, the profiling is turned off. | ||
|
||
To enable profiling you need to specify address to config parameter `pprof-addr`, for example: | ||
|
||
``` | ||
telegraf --config telegraf.conf --pprof-addr localhost:6060 | ||
``` | ||
|
||
There are several paths to get different profiling information: | ||
|
||
To look at the heap profile: | ||
|
||
`go tool pprof http://localhost:6060/debug/pprof/heap` | ||
|
||
or to look at a 30-second CPU profile: | ||
|
||
`go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30` | ||
|
||
To view all available profiles, open `http://localhost:6060/debug/pprof/` in your browser. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have all the information we need to print the full url to this page, let have it write something like:
I! Starting pprof HTTP server at http://localhost:6060/debug/pprof
This way I can click on it or copy paste it more easily.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielnelson, thanks for review. Changes done.
Could you also move forward our contributions:
#2387
#2594
We hope to see them in 1.3 too