Skip to content
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

Merged
merged 4 commits into from Apr 21, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Apr 14, 2015

No description provided.

@tsteur tsteur added the Needs Review PRs that need a code review label Apr 14, 2015
@mattab mattab added this to the Piwik 2.13.0 milestone Apr 17, 2015
'Enable profiling with XHProf'
);

$this->getDefinition()->addOption($option);
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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)?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #7708

@diosmosis
Copy link
Member

Can we remove the xhprof param from the core:archive command?

@tsteur
Copy link
Member Author

tsteur commented Apr 19, 2015

The core:archive does some additional work, eg it does forward the --xhprof param to all requests but we can remove the option itself.

@diosmosis
Copy link
Member

@tsteur If you rebase/merge, I'll merge the PR.

tsteur added a commit that referenced this pull request Apr 21, 2015
Added possibility to profile any command by setting the option --xhprof
@tsteur tsteur merged commit 45a8ac3 into master Apr 21, 2015
@tsteur tsteur deleted the console_profiling branch April 21, 2015 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants