-
Notifications
You must be signed in to change notification settings - Fork 71
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
Draft: Add profiling to leapp and snactor #676
base: main
Are you sure you want to change the base?
Conversation
Currently on some machines the run of the leapp / snactor is too slow. Especially framework itself should be fast but sometimes the time differences are in order of tens seconds. From this point, it seems useful to be able to start profilling based on the env variable when it is needed.
Co-Authored-By: pirat89 <[email protected]>
Can one of the admins verify this patch? |
The same profiling code also works in leapp with minimal changes. It could be useful, although it shows more than 90% of the time spent in posix.waitpid. Also import StringIO from six instead.
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the If you want to re-run tests or request review, you can use following commands as a comment:
Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra. |
A value of 1 is still required to turn profiling on.
oh man
eb8fc97
to
646755a
Compare
os.environ['LEAPP_CPROFILE'] = os.environ.get('LEAPP_CPROFILE', '0') | ||
profile_enabled = os.environ['LEAPP_CPROFILE'] == '1' |
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.
os.environ['LEAPP_CPROFILE'] = os.environ.get('LEAPP_CPROFILE', '0') | |
profile_enabled = os.environ['LEAPP_CPROFILE'] == '1' | |
profile_enabled = os.environ.get('LEAPP_CPROFILE', '0') == '1' |
os.environ['LEAPP_CPROFILE'] = os.environ.get('LEAPP_CPROFILE', '0') | ||
profile_enabled = os.environ['LEAPP_CPROFILE'] == '1' |
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.
os.environ['LEAPP_CPROFILE'] = os.environ.get('LEAPP_CPROFILE', '0') | |
profile_enabled = os.environ['LEAPP_CPROFILE'] == '1' | |
profile_enabled = os.environ.get('LEAPP_CPROFILE', '0') == '1' |
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.
How do you see the usage of this tool? How actually the profiling process will look like? Could you provide a snippet, what the developer will see?
Picking up where #482 left off. For science, profit and fun.
LEAPP_CPROFILE=1
turns on the profiler and shows stats after a successful execution. Maybe an option would be better instead...