emteknetnz / db-query-counter
A SilverStripe module for query counting.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
This package is auto-updated.
Last update: 2025-04-04 12:01:27 UTC
README
This is a SilverStripe module for counting and analyzing database queries.
Installation
composer require emteknetnz/query-counter
Usage
- Add
?log=1
to the URL to enable query logging for the current request. You should probably delete this from the URL bar straight away so that extra queries are not logged on subsequent requests. - To reset the query log, add
?reset=1
to the URL - The view a report of the queries, run
vendor/bin/sake dev/tasks/QueryCounterTask
from the command line.
Notes
- The log and report are written to the system temp directory
- A
DBQueryMySQLiConnector
class is injected in to replaceMySQLiConnector
to allow for logging database queries. If you have a custom connector, you will need to extend this class instead ofMySQLiConnector
.