Skip to content

Commit

Permalink
Update docs to new technique of having to hit another url
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Jul 5, 2021
1 parent 47d405e commit f00a97b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/users/xhprof-profiling.md
Expand Up @@ -4,12 +4,12 @@ DDEV-Local has built-in support for [xhprof](https://www.php.net/manual/en/book.

### Basic xhprof Usage

* Enable xhprof with `ddev xhprof enable` (or `ddev xhprof` or `ddev xhprof on`) and see status with `ddev xhprof status`
* Use a web browser or other technique to visit a page whose performance you want to study.
* On some CMSs, there will be a link to "xhprof profiler output" so you can study the page. (For example, on Drupal 7 at least with the default theme, it's at the bottom of the page, on TYPO3 v10 it's in the upper left.) On other CMSs the output is suppressed and you'll need to visit `/xhprof/` (for example, `https://project.ddev.site/xhprof/`) and click the first listed link.
* Enable xhprof with `ddev xhprof on` (or `ddev xhprof` or `ddev xhprof enable`) and see status with `ddev xhprof status`
* `ddev xhprof on` will show you the URLs you can use to see the xhprof analysis, `https://<projectname>.ddev.site/xhprof/latest` for the latest run or `https://<projectname>.ddev.site/xhprof` for all recent runs.
* Use a web browser or other technique to visit a page whose performance you want to study. To eliminate first-time cache-building issues, you may want to hit it twice.
* Visit one of the links provided by `ddev xhprof on` and study the results.
* On the profiler output page you can drill down to the function that you want to study, or use the graphical "View Full Callgraph" link. Click the column headers to sort by number of runs and inclusive or exclusive wall time, then drill down into the function you really want to study and do the same.
* Visit `<project_url>/xhprof/` (for example, `https://project.ddev.site/xhprof/`) to see and study all the runs you have captured. (These are erased on `ddev restart`.)
* The runs are erased on `ddev restart`.
* If you are using webserver_type apache-fpm and you have a custom .ddev/apache/apache-site.conf, you'll need to make sure it has the `Alias "/xhprof" "/var/www/xhprof/xhprof_html"` in it that the [provided apache-site.conf](https://github.com/drud/ddev/blob/master/pkg/ddevapp/webserver_config_assets/apache-site-php.conf) has.

For a tutorial on how to study the various xhprof reports, see the section "How to use XHPROF UI" in [A Guide to Profiling with XHPROF](https://inviqa.com/blog/profiling-xhprof). It takes a little time to get your eyes used to the reporting. (You do not need to do any of the installation described in that article, of course.)

0 comments on commit f00a97b

Please sign in to comment.