-
Notifications
You must be signed in to change notification settings - Fork 3k
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
{Misc} Fix timer for __main__.py #13844
Conversation
add to S171 |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Because
Thus, Since there is no support for file-level |
logger.info("command ran in %.3f seconds.", elapsed_time) | ||
# Log the invoke finish time | ||
invoke_finish_time = timeit.default_timer() | ||
logger.info("Command ran in %.3f seconds (init: %.3f, invoke: %.3f)", |
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 am not sure if this running time info should be moved to logger.debug
. I am open to this.
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.
Would it better to calculate the execution time under certain situations such as debug mode, --verbose mode, etc.
But this modifcation doesn't bring any (significant) regression, So, LGTM.
The execution time is calculated regardless of the execution mode (verbose, debug). Anyway, the overhead of calling |
Description
Fix the incorrect timing logic. Previous it only takes
invoke
duration into account, while forgetting about theinit
duration.This PR fixes the timing logic to include both
init
andinvoke
duration.Testing Guide
Before:
After: