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
- guzzlehttp/promises: ^2.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.1.2
- konradmichalik/ttt: ^0.4.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
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 1.0.0
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- dev-docs/rename-docs-kebab-case
- dev-feat/http-client-timing-section
- dev-feat/write-profile-on-exception
- dev-chore/bump-reusable-workflows-0.1.0
- dev-chore/pin-reusable-workflows-0.0.1
- dev-docs/fix-coverage-badge
- dev-feature/artifact-provenance-metadata
- dev-feature/activation-mode-toggle-retention
This package is auto-updated.
Last update: 2026-09-22 04:13:23 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.
✨ Features
- Timing and memory: wall-clock and SQL timing, peak memory usage, included PHP file count
- Query analysis: full query count, top slow queries, and N+1 duplicate detection
- Outgoing HTTP client calls: count, total time, and the slowest requests
- Cache state: hit/miss with disabled reasons
- Log activity: count by level and the noisiest components
- Optional query tracing: call-site origin (
Class::method (file:line)) for every flagged query, see Configuration - Optional PSR-14 event timing: count and the most expensive event classes, see Configuration
- Uncaught exceptions: class, file, and line, never the message, even though no response was produced
🔥 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).
🚀 Quick start
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.
🔗 Related
typo3-ai-mate: asymfony/ai-matebridge that serves these profiles to AI coding assistants over MCP
📚 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).