izquierdogalan/benchmark-bundle

Show benchmark functions, apis, controlers, etc

1.0.0 2015-06-13 15:57 UTC

This package is not auto-updated.

Last update: 2024-04-27 16:31:06 UTC


README

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.

Build Status 68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33633131376234372d643732652d346465642d393731622d6466383433633639396439342f6269672e706e67

Installation and configuration:

Get the bundle

Add to your composer.json file :

composer require izquierdogalan/benchmark-bundle

Add BenchmarkBundle to your application kernel

<?php

    // app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new JMS\AopBundle\JMSAopBundle(),
            new Easys\BenchmarkBundle\EasysBenchmarkBundle(),
            // ...
        );
    }

Add in your config.yml

jms_aop:
    cache_dir: %kernel.cache_dir%/jms_aop

Usage examples:

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');
  }