https://github.com/tyler36/ddev-dbslow
Helper to log "slow" queries
https://github.com/tyler36/ddev-dbslow
database ddev-get debugging mysql
Last synced: 5 months ago
JSON representation
Helper to log "slow" queries
- Host: GitHub
- URL: https://github.com/tyler36/ddev-dbslow
- Owner: tyler36
- License: apache-2.0
- Created: 2024-02-01T04:56:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-27T01:01:07.000Z (about 1 year ago)
- Last Synced: 2025-05-29T01:39:31.538Z (about 1 year ago)
- Topics: database, ddev-get, debugging, mysql
- Language: Shell
- Homepage:
- Size: 85 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://addons.ddev.com)
[](https://github.com/tyler36/ddev-dbslow/actions/workflows/tests.yml)
[](https://github.com/tyler36/ddev-dbslow/commits)
[](https://github.com/tyler36/ddev-dbslow/releases/latest)
# dbslow
- [What is dbslow?](#what-is-dbslow)
- [Getting started](#getting-started)
- [Usage](#usage)
- [Starting and stopping](#starting-and-stopping)
- [Viewing](#viewing)
- [TODO](#todo)
## What is dbslow?
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](https://github.com/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.
## Getting started
1. Install the addon.
```shell
ddev add-on get tyler36/ddev-dbslow
```
2. Restart DDEV.
```shell
ddev restart
```
## Usage
## Starting and stopping
- `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.
## Viewing
- `ddev dbslow view`: Display the log file.
- `ddev dbslow tail`: Stream the log file in the terminal.
## TODO
- [ ] Add configuration options for settings.
- [ ] Add tests for `ddev dbslow tail`
- [ ] Add tests for MySQL
- [ ] Add support for Postgres
**Contributed and maintained by [@tyler36](https://github.com/tyler36)**