-
Notifications
You must be signed in to change notification settings - Fork 720
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
api: add pprof zip api #4017
api: add pprof zip api #4017
Conversation
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: bufferflies <1045931706@qq.com>
Codecov Report
@@ Coverage Diff @@
## master #4017 +/- ##
==========================================
- Coverage 74.47% 74.45% -0.02%
==========================================
Files 256 257 +1
Lines 25877 25948 +71
==========================================
+ Hits 19272 19320 +48
- Misses 4882 4894 +12
- Partials 1723 1734 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
// @Produce application/octet-stream | ||
// @Router /pprof/debug/zip [get] | ||
func (h *ProfHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | ||
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="pd_debug"`+time.Now().Format("20060102_150405")+".zip")) |
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.
The format is a little bit different with TiDB.
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.
yes, it will be better to splite date and time
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 can let tidb with the new format.
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: bba56e0
|
/test |
* add debug zip Signed-off-by: bufferflies <1045931706@qq.com> * change zip name and time format Signed-off-by: bufferflies <1045931706@qq.com> * import、annotation、log Signed-off-by: bufferflies <1045931706@qq.com> * pass ut Signed-off-by: bufferflies <1045931706@qq.com> * add unit test Signed-off-by: bufferflies <1045931706@qq.com> * pass ut Signed-off-by: bufferflies <1045931706@qq.com> * refine api route Signed-off-by: bufferflies <1045931706@qq.com> * pass ut Signed-off-by: bufferflies <1045931706@qq.com> * remove new prof handler Signed-off-by: bufferflies <1045931706@qq.com> * code lint Signed-off-by: bufferflies <1045931706@qq.com> Co-authored-by: ShuNing <nolouch@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
What problem does this PR solve?
relate: #4013
What is changed and how it works?
put pprof ,goroutine ,mutex,allocs,config,version to zip file
Check List
Tests
Code changes
Side effects
Related changes
Release note