-
Notifications
You must be signed in to change notification settings - Fork 334
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
feat: Add HTTP API for cpu profiling #1694
Merged
Merged
Conversation
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
sunng87
reviewed
Jun 1, 2023
evenyag
force-pushed
the
feat/pprof
branch
3 times, most recently
from
June 2, 2023 10:01
751c3ba
to
3f74d4f
Compare
The default timeout layer can abort the perf API
|
refactor the mem_prof handler to avoid checking feature while registering router
Codecov Report
@@ Coverage Diff @@
## develop #1694 +/- ##
===========================================
- Coverage 86.58% 86.23% -0.36%
===========================================
Files 575 578 +3
Lines 93294 93360 +66
===========================================
- Hits 80782 80509 -273
- Misses 12512 12851 +339 |
v0y4g3r
reviewed
Jun 6, 2023
v0y4g3r
approved these changes
Jun 6, 2023
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.
LGTM
MichaelScofield
added
C-documentation
Improvements or additions to documentation IN THIS REPO
docs-required
This change requires docs update.
labels
Jun 7, 2023
fengjiachun
approved these changes
Jun 7, 2023
paomian
pushed a commit
to paomian/greptimedb
that referenced
this pull request
Oct 19, 2023
* chore: print source error in mem-prof * feat(common-pprof): add pprof crate * feat(servers): Add pprof handler to router refactor the mem_prof handler to avoid checking feature while registering router * feat(servers): pprof handler support different output type * docs(common-pprof): Add readme * feat(common-pprof): Build guard using code in pprof-rs's example * feat(common-pprof): use prost * feat: don't add timeout to perf api * feat: add feature pprof * feat: update readme * test: fix tests * feat: close region in TestBase * feat(pprof): addres comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-documentation
Improvements or additions to documentation IN THIS REPO
docs-required
This change requires docs update.
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.
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
This PR adds an HTTP API for CPU profiling. It also refactors the mem prof handler to make chaining handlers to the router easier.
Sample at 99 Hertz, for 5 seconds, output report in protobuf format.
Sample at 99 Hertz, for 60 seconds, output report in flamegraph format.
Sample at 49 Hertz, for 10 seconds, output report in text format.
This feature is disabled by default. To enable it, we need to build the binary with
pprof
featureBecause the pprof API needs to sample for a specific duration, we must apply the timeout layer before it.
Note that this might panic on Apple silicon chips (M1/M2)
This PR also closes the test region in TestBase which should fix the test case
test_flush_and_reopen
.Checklist
Refer to a related PR or issue link (optional)