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
Added possibility to profile any command by setting the option --xhprof #7675
Conversation
'Enable profiling with XHProf' | ||
); | ||
|
||
$this->getDefinition()->addOption($option); |
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.
Can you add this only if development mode is enabled?
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.
Nah, you don't want to profile when development mode is enabled... it wouldn't cache, perform extra checks etc.
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.
In that case, can we echo a warning or throw an exception when trying to profile w/ development mode is enabled (would do this when calling setupProfilerXhprof for the main run)?
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.
Not sure, we could log a warning and remove it once it becomes a problem. Eg someone might enable development mode on purpose to profile things uncached etc. Adding this logger would be a new issue I reckon as we would need to do this also when using xhprof=1
in a URL.
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.
Maybe in the summary output (that includes a link to the profile) we can print whether Development mode is enabled, and a note that says nothing is cached and you may want to run w/ it disabled, etc.
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.
Created #7708
Can we remove the xhprof param from the core:archive command? |
The core:archive does some additional work, eg it does forward the |
@tsteur If you rebase/merge, I'll merge the PR. |
9f58dd3
to
5e85665
Compare
Added possibility to profile any command by setting the option --xhprof
No description provided.