In BEdita 3.4 we are introducing XHProf integration.
XHProf is a nice tool to profile your application performance that, unlike XDebug and other tools, you can use in production systems not affecting too much the overall performance.
- install XHprof - remember to define output directory
xhprof.output_dir=/path/to/dir, with correct permissions, then verify that the script works as expected in the default UI - initially you will see and empty list of "runs"
- enable profiling in BEdita, simply write
$config['enableProfiling'] = true;in bedita-app/config/bedia.cfg.php
- now use your application and point to the xhprof_html frontend script, you will see your runs - that's it!
NOTE: Profile run file names will have this form
url, is the full base url of your app without dots. You can then select the interesting "runs".
With configuration explained above you will profile backend application and every frontend application you have in frontends.
To profile only a frontend application simply comment out the line at 2. in bedita.cfg.php and write the same line in frontends/[your-frontend]/config/frontend.cfg.php
To profile only backend application, put in every frontends/[your-frontend]/config/frontend.cfg.php
$config['enableProfiling'] = false;
TECH NOTE: profiling starts at
AppController::beforeFilter and ends at
AppController::afterFitler, so there's still some code not profiled, mainly bootstrap and inital config file loading.