2017 © Pedro Peláez
 

symfony-bundle execution-stats

This bundle logs the time execution of methods, and supply stats data.

image

urodoz/execution-stats

This bundle logs the time execution of methods, and supply stats data.

  • Monday, March 4, 2013
  • by urodoz
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

TimeExecutionStatsBundle

Service to handle progress of time execution of service and methods in your Symfony2 application, (*1)

Installation on Symfony with Composer

On the composer.json file add :, (*2)

``` json, (*3)

"require": {
    "urodoz/execution-stats": "dev-master",        
}

Run composer update

php composer.phar update, (*4)


Add the bundle to the *AppKernel.php* ``` php <?php $bundles = array( new Urodoz\TimeExecutionStatsBundle\UrodozTimeExecutionStatsBundle(); );

You can add the bundle only in dev and test environment as follows, (*5)

``` php, (*6)

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    //Adding bundle to dev and test environments
    $bundles[] = new Urodoz\TimeExecutionStatsBundle\UrodozTimeExecutionStatsBundle();
}

Update the *Doctrine* schema (you can use --dump-sql option before to check the SQL executed). The tracking time data is stored on a log table inside your data model.

php app/console doctrine:schema:update --force, (*7)


Usage as Symfony 2 service -------------------------- You can access now to the time tracking service **urodoz.timeTracker**. The parameters to track a service are : * Name : Name (unique) of the tracking item * Tag : Used to group results * Version : The version of the service. Can be a generic parameter setted for all platform. The graphs will show the progression of performance between different versions. Example of tracking : ``` php protected function doSomeTask() { //Head of the method if($this->getContainer()->has("urodoz.timeTracker")) { $this->get('urodoz.timeTracker')->start( "user.doSomeTask", "UserBundle", $this->container->getParameter("appVersion")); } ... //code ... if($this->getContainer()->has("urodoz.timeTracker")) { $this->get('urodoz.timeTracker')->stop("user.doSomeTask"); } }

See tracking data on Symfony 2 commands

Once the bundle has been installed. You have access to 3 new commands on your app/console :, (*8)

php app/console urodoz:statsbundle:pack

Will pack the data on database, (*9)

php app/console urodoz:statsbundle:ranking

Show the slower tracking methods or services , optionally grouped by tags, (*10)

php app/console urodoz:statsbundle:show

Show data of performance improve, referenced from the last versions of a single service. Here you can see how the service has progressd into different versions in execution time, (*11)

See tracking data generated on HTML

Currenty on development, (*12)

Integrate tracking data into Jenkins application

Currenty on development, (*13)

The Versions

04/03 2013

dev-master

9999999-dev https://github.com/urodoz/execution-stats

This bundle logs the time execution of methods, and supply stats data.

  Sources   Download

MIT

The Requires

 

log symfony timer performance stats jenkins