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.

Maintainers

Package info

github.com/konradmichalik/typo3-request-profiler

Type:typo3-cms-extension

pkg:composer/konradmichalik/typo3-request-profiler

Transparency log

Statistics

Installs: 3 864

Dependents: 1

Suggesters: 0

Stars: 2

Open Issues: 1

0.5.1 2026-07-29 11:42 UTC

README

Extension icon

TYPO3 extension typo3_request_profiler

TYPO3 Supported PHP Versions CGL Coverage Tests License

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

Packagist Packagist Downloads

composer require --dev konradmichalik/typo3-request-profiler

TER

TER version TER downloads

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).