PinbaBundle is Symfony bundle for pinba.
Important! Include this bundle only in `prod` environment.
It collects and sends times of execution for Doctrine queries, Twig renders and Redis requests as pinba timers to pinba server. You can watch collected realtime metrics in Intaro Pinboard. Example of output:
Also PinbaBundle changes pinba script_name variable to request_uri value otherwise pinba sends app.php in script_name for the requests.
PinbaBundle requires Symfony 4.4 or higher.
Require the bundle in your composer.json file:
{
"require": {
"intaro/pinba-bundle": "^2.0",
}
}Important! Register the bundle in prod environment:
// app/AppKernel.php
public function registerBundles()
{
$bundles = [
//...
];
if ('prod' === $this->environment) {
$bundles[] = new Intaro\PinbaBundle\IntaroPinbaBundle();
}
//...
}Install the bundle:
$ composer update intaro/pinba-bundle
PinbaBundle automatically configures script_name variable of pinba.
PinbaBundle automatically collects metrics for Twig renders.
Edit app/config/config_prod.yml and add this lines:
doctrine:
dbal:
logging: trueDon't worry. This config enables pinba logger which collects only queries execution time but not logs them.
Install vendors:
make vendorRun php-cs-fixer, phpstan and phpunit:
make check