This Bundle provides @Benchmark annotation for symfony 2 for show log with a duration time process a determinated function or controler. This bundle required JMSAopBundle.
Add to your composer.json
file :
composer require izquierdogalan/benchmark-bundle
<?php
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new JMS\AopBundle\JMSAopBundle(),
new Easys\BenchmarkBundle\EasysBenchmarkBundle(),
// ...
);
}
jms_aop:
cache_dir: %kernel.cache_dir%/jms_aop
You must use in controller or simple function allowed in methods:
<?php
/**
* @Route("/{page}", name="home", defaults={"page": 1}, requirements={"page": "\d+" }, methods = { "GET" })
* @Benchmark(description="Load index page.")
*/
public function indexAction($page)
{
return $this->render('EasysVideoPortalBundle:Orbit:Pages/index.html.twig');
}