Add "--enable-profiler" flag to all the StackStorm services + CLI#5199
Merged
Add "--enable-profiler" flag to all the StackStorm services + CLI#5199
Conversation
Kami
commented
Mar 21, 2021
| from st2client.commands.auth import TokenCreateCommand | ||
| from st2client.commands.auth import LoginCommand | ||
|
|
||
| from st2client.utils.profiler import setup_regular_profiler |
Member
Author
There was a problem hiding this comment.
NOTE: st2client can't depend on st2common that's why we intentionally need to duplicate the code in this package.
This flag can be used to enable cProf based profiler for debugging and troubleshooting purposes.
oslo config for parsing CLI options.
Contributor
|
Can we use a different profiler? Something like Scalene? |
Member
Author
|
@blag We probably could for code which doesn't rely on eventlet. For most rest of the code which relies on eventlet we probably can't use it (unless that profiler knows how to handle eventlet code and context switching). |
cognifloyd
approved these changes
Oct 2, 2021
Member
|
@Kami looks like all you have to do is re-sign the CLA (which we changed recently to say Linux Foundation instead of one of the previous StackStorm stewards). |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request adds
--enable-profilerflag to all the StackStorm services + CLI which can be used to profiler the code using cProf based profiler during development and troubleshooting.Keep in mind that cProf offers only basic information and usually when drilling down (into a function) you need to use line profiler, but this may not working as expected our of the box due to our usage of eventlet (need to add some docs on that).