sensiolabs/doctrine-query-statistics-bundle
A Symfony bundle that gathers Doctrine ORM query statistics and surfaces them in the web debug toolbar and profiler, making it easier to monitor query counts and execution times while spotting inefficient database access during development.
doctrine/doctrine-bundle and the Web Profiler enabled — this bundle targets that era and is archived, so it is a maintenance-only tool, not something to introduce into new projects.composer require --dev sensiolabs/doctrine-query-statistics-bundle.config_dev.yml/AppKernel dev branch (or config/bundles.php if you've backported the bundle into a Symfony 4 app). Add SensioLabs\Bundle\DoctrineQueryStatisticsBundle\SensioLabsDoctrineQueryStatisticsBundle to the dev/test bundle list.DependencyInjection/Configuration.php, its DataCollector, and its SQL logger decorator — those tell you exactly which config keys exist (typically enable/disable and thresholds) and how queries are intercepted.dev environment, click the Web Profiler toolbar, and select the new Doctrine Query Statistics panel. You'll see queries aggregated by SQL text with execution counts and cumulative timings — the fastest way to spot N+1 and repeated queries on a page.framework.profiler in config_dev.yml, and that DBAL logging is enabled (doctrine.dbal.logging: true or the profiler middleware, depending on Symfony version).test too, run functional tests through a kernel request, pull the collector from the profiler ($client->getProfile()->getCollector('...')) and assert query counts/timings stayed within a budget. This turns the panel's data into regression protection.DataCollector, reuse its logger decorator, and register the collector with the data_collector tag and a template under Resources/views/Collector/.app/Resources/SensioLabsDoctrineQueryStatisticsBundle/ (or equivalent) to add columns or filters without touching vendor code.composer.json, and be ready to fork or vendor it if patching is needed. Check PHP constraints before installing on an upgraded runtime.framework.profiler strictly in config_dev.yml.SQLLogger/middleware decorator replaced the one the bundle expects. Logger decorators do not always stack cleanly.cache:clear (or rm -rf var/cache/dev) and re-check; stale dev caches frequently make config changes look ignored.var/cache/dev/profiler/ (or the _profiler route) to see the raw collected array when the tab renders incorrectly.services.yml rather than editing vendor code so the bundle can still be removed cleanly.How can I help you explore Laravel packages today?