This addon is designed to log slow queries (>1 second). Slow queries degrade site performance. By tracking slow queries, developer gain insight to how the database is being used and specific areas to focus for improvement.
This addon was inspired by ChromaticHQ/ddev-dblog. The main difference is
ddev-dblog
logs all queries.ddev-dbslow
logs queries slow queries (>1 second)
As both addons mature, it is possible this functionality will merge into ddev-dblog
or DDEV core.
-
Install the addon.
For DDEV v1.23.5 or above run
ddev add-on get tyler36/dbslow
For earlier versions of DDEV run
ddev get tyler36/dbslow
-
Restart DDEV.
ddev restart
ddev dbslow on
: Start logging slow queries.ddev dbslow off
: Stop logging slow queries.ddev dbslow toggle
: Toggle the current state of the logging. Ie. OFF => ON, ON => OFF.
ddev dbslow view
: Display the log file.ddev dbslow tail
: Stream the log file in the terminal.
- Add configuration options for settings.
- Add tests for
ddev dbslow tail
- Add tests for MySQL
- Add support for Postgres
Contributed and maintained by @tyler36