dawen/dic-service-benchmark-bundle

Test the service instantiation time.

Installs: 6 810

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

0.2.0 2015-12-22 12:20 UTC

This package is not auto-updated.

Last update: 2024-11-23 19:00:39 UTC


README

This code will instantiate every registered service from the DIC and checks the time taken.

Installation

Require the dawen/dic-service-benchmark-bundle package in your composer.json and update your dependencies.

    $ composer require dawen/dic-service-benchmark-bundle

This bundle contains no code for Runtime, or any services. You don't have to add it to your AppKernel.

Usage

Check out where you phpunit is installed and run (hint: disable coverage for this test):

    bin/phpunit -c app vendor/dawen/dic-service-benchmark-bundle/Dawen/Bundle/DicServiceBenchmarkBundle/Tests/DicServiceBenchmarkTest.php

This will print out a list of services and their time elapsed when instantiating. This test will fail, if services will take longer than 50ms.

If you want to ignore service id's you can add in your phpunit.xml a global war that holds all service id's colon separated.

  <php>
      <var name="dic-service-benchmark-ignore" value="web_profiler.controller.router,my-service"/>
  </php>