This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
br: Add TLS support for PProf of BR #824
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e317dc4
br: pprof now supports TLS
YuJuncen 08a0f4b
tests: remove a TODO
YuJuncen be58b8d
br: fix dynamic pprof listen addr
YuJuncen 43f1b86
utils: extract common part of startPProf*
YuJuncen ecefa8c
Merge branch 'master' into tlspprof
YuJuncen ebe1b28
Merge branch 'master' into tlspprof
YuJuncen 9ad2cb2
br: refactor pprof
YuJuncen fbe6bb8
Merge branch 'tlspprof' of https://github.com/YuJuncen/br into tlspprof
YuJuncen f4ccd82
br: refine some code
YuJuncen 2f051c3
br: use tidbutils.TLS
YuJuncen 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
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
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.
Prefer pass arguments explicitly instead of a closure.
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.
This function is an internal function, I think if we pass arguments here, we probably need to provide TLS config explicitly here, like
StartDynamicPProfListener(cert, key string)
. At the implementation might would be like:We got more args, and function overloading-like magic... Without more information, I'm afraid I would prefer the current style...
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.
We can move the if condition into the
StartPProfListener
.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.
Yep, I think those would make a
if
statement within the function, whose condition is the new parameter we added. And in my opinion this is also control coupling or another form of function overloading.I think make another function(
StartPProfListenerTLS
) and let user to decide how to start the pprof listener by callback in theStartDynamicPProfListener
would be more flexible.I'm wondering if there are some style guides preferring plain arguments or some bad things happened with closures...? If so, I will surely remove those.