EPWTXhprofBundle provides XHProf integration to Symfony profiler and wrapper for XHProf simple usage anywhere in project.
composer require --dev epwt/xhprof "~1.0"
Register EPWTXhprofBundle in AppKernel.php file. I suggest to use it only in development or testing environment
public function registerBundles()
{
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new EPWT\XhprofBundle\EPWTXhprofBundle();
}
}
To use XHProf anywhere in project just initiate profiling by using global function:
xhprofStart('Name of sample');
To end profiling use:
xhprofEnd();
for($a = 0; $a < 20; $a++) {
xhprofStart('Hello world');
for ($i = 0; $i < 20; $i ++) {
sleep(0.1);
}
xhprofEnd();
}
This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE
EPWTXhprofBundle is brought to you by Aurimas Niekis.
Issues and feature requests are tracked in the Github issue tracker.
When reporting a bug, it may be a good idea to reproduce it in a basic project built using the Symfony Standard Edition to allow developers of the bundle to reproduce the issue by simply cloning it and following some steps.
How can I help you explore Laravel packages today?