intaro / pinba-bundle
Collects and sends execution time of Doctrine queries, Twig renders and Redis requests as pinba timers to pinba server
Installs: 519 929
Dependents: 1
Suggesters: 0
Security: 0
Stars: 22
Watchers: 10
Forks: 15
Open Issues: 3
Type:symfony-bundle
Requires
- php: >=7.4
- symfony/framework-bundle: ^4.0|^5.0|^6.0
- symfony/yaml: ^4.0|^5.0|^6.0
Requires (Dev)
- doctrine/dbal: ^2|^3|^4
- friendsofphp/php-cs-fixer: 3.4
- nyholm/symfony-bundle-test: ^2.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^8.5|^9.5
- psr/log: ~1.0|^2|^3
- symfony/config: ^4.4|^5.0|^6.0
- symfony/dependency-injection: ^4.4|^5.0|^6.0
- symfony/deprecation-contracts: ^1.1|^2.0|^3
- symfony/error-handler: ^4.4|^5.0|^6.0
- symfony/event-dispatcher: ^4.4|^5.0|^6.0
- symfony/event-dispatcher-contracts: ^1.1|^2.0|^3
- symfony/filesystem: ^4.4|^5.0|^6.0
- symfony/finder: ^4.4|^5.0|^6.0
- symfony/http-foundation: ^4.4|^5.0|^6.0
- symfony/http-kernel: ^4.4|^5.0|^6.0
- symfony/phpunit-bridge: ^5.0|^6.0
- symfony/routing: ^4.4|^5.0|^6.0
- symfony/templating: ^4.4|^5.0|^6.0
- symfony/translation-contracts: ^1.1|^2.0
- symfony/twig-bridge: ^4.4|^5.0|^6.0
- symfony/twig-bundle: ^4.4|^5.0|^6.0
- symfony/var-dumper: ^4.4|^5.0|^6.0
- symfony/var-exporter: ^4.4|^5.0|^6.0
- twig/twig: ^v2.14 || ^3.0
README
About
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.
Installation
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
Usage
Configure script_name
PinbaBundle automatically configures script_name
variable of pinba.
Collecting Twig metrics
PinbaBundle automatically collects metrics for Twig renders.
Collecting Doctrine metrics
Edit app/config/config_prod.yml
and add this lines:
doctrine: dbal: logging: true
Don't worry. This config enables pinba logger which collects only queries execution time but not logs them.
Development
Run tests
Install vendors:
make vendor
Run php-cs-fixer, phpstan and phpunit:
make check