konradmichalik / typo3-request-profiler
Dev-only TYPO3 frontend request profiler that records SQL queries, N+1 patterns, cache state and timing as compact JSON profiles for AI coding assistants.
Package info
github.com/konradmichalik/typo3-request-profiler
Type:typo3-cms-extension
pkg:composer/konradmichalik/typo3-request-profiler
Requires
- php: ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
- doctrine/dbal: ^3.9 || ^4.0
- psr/event-dispatcher: ^1.0
- psr/http-message: ^1.0 || ^2.0
- psr/http-server-handler: ^1.0.2
- psr/http-server-middleware: ^1.0.2
- psr/log: ^3.0.2
- symfony/console: ^6.4 || ^7.0 || ^8.0
- typo3/cms-core: ^13.4 || ^14.0
- typo3/cms-frontend: ^13.4 || ^14.0
Requires (Dev)
- composer/class-map-generator: ^1.7.3
- eliashaeussler/version-bumper: ^4.0.3
- konradmichalik/ttt: ^0.3.0
- phpunit/phpcov: ^9.0 || ^10.0 || ^11.0 || ^13.0
- phpunit/phpunit: ^10.5 || ^11.0 || ^12.0 || ^13.0
- typo3/cms-base-distribution: ^13.4 || ^14.0
- typo3/cms-lowlevel: ^13.4 || ^14.0
- typo3/testing-framework: ^8.2 || ^9.5
This package is auto-updated.
Last update: 2026-07-29 11:47:38 UTC
README
TYPO3 extension typo3_request_profiler
A dev-only TYPO3 frontend request profiler. It instruments live frontend requests and writes one compact JSON profile per request (SQL queries, N+1 patterns, cache state, and timing) to var/log/profiles/{request_id}.json.
Important
This extension is active by default only in a Development context (Environment::getContext()->isDevelopment()). Outside Development it stays off and collects no data unless explicitly opted in; see Activation.
The profiler is a thin, standalone collector with no external dependencies. It is inspired by the Symfony Profiler and by some of the metrics the TYPO3 Admin Panel surfaces, but records them as compact, machine-readable JSON instead of an interactive panel.
What it captures per request:
- Wall-clock and SQL timing, peak memory usage, included PHP file count
- Full query count + top slow queries + N+1 duplicate detection
- Cache hit/miss state with disabled reasons
- Log activity per request (count by level + noisiest components)
- Optional call-site origin (
Class::method (file:line)) for every flagged query - Optional PSR-14 event timing (count + the most expensive event classes)
🔥 Installation
Requirements
- TYPO3 13.4 LTS & 14.0+
- PHP 8.2+
- Doctrine DBAL 3.x or 4.x
Composer
composer require --dev konradmichalik/typo3-request-profiler
TER
Download the zip file from TYPO3 extension repository (TER).
💡 Example
Start it up in a Development context (no configuration needed) and every request writes a compact JSON profile to var/log/profiles/{request_id}.json:
{
"schemaVersion": 1,
"token": "<RequestId>",
"url": "https://example.ddev.site/",
"status": 200,
"meta": { "activationMode": "context" },
"timing": { "total_ms": 142.5 },
"queries": { "count": 101, "total_ms": 38.2 },
"slow_queries": [
{ "sql": "SELECT * FROM pages WHERE slug = ? ORDER BY slug desc", "ms": 12.4 }
]
}
That's the gist. The full artifact also carries cache state, memory usage, PHP include count, N+1 duplicate-query detection, log activity, and optional PSR-14 event timing. See Profile Format for the complete schema.
📚 Documentation
| Topic | What's inside |
|---|---|
| Activation | Development context, forcing it elsewhere via an env var, the profiler:activate CLI toggle, and the HTTP header trigger for per-request correlation |
| Configuration | Sampling threshold, retention, query tracing, and PSR-14 event timing |
| Profile Format | The full JSON schema, provenance metadata, and the ProfileReader read API |
🧑💻 Contributing
Please have a look at CONTRIBUTING.md.
⭐ License
This project is licensed under GNU General Public License 2.0 (or later).