ascetic-soft/rowcast-profiler

SQL query profiler for Rowcast via ConnectionInterface decoration

Maintainers

Package info

github.com/ascetic-soft/RowcastProfiler

pkg:composer/ascetic-soft/rowcast-profiler

Statistics

Installs: 9

Dependents: 1

Suggesters: 1

Stars: 0

Open Issues: 0

v1.0.3 2026-06-08 19:36 UTC

This package is auto-updated.

Last update: 2026-06-08 19:39:55 UTC


README

Lightweight SQL profiler for Rowcast: subscribes to AsceticSoft\Rowcast\ConnectionInterface query events to record timings, parameters (sanitized), errors, and simple aggregates.

Install

composer require ascetic-soft/rowcast-profiler

Usage

use AsceticSoft\Rowcast\Connection;
use AsceticSoft\RowcastProfiler\ConnectionProfiler;
use AsceticSoft\RowcastProfiler\InMemoryQueryProfileStore;
use AsceticSoft\RowcastProfiler\DefaultParameterSanitizer;
use AsceticSoft\RowcastProfiler\RowcastProfiler;

$inner = Connection::create('sqlite::memory:');
$store = new InMemoryQueryProfileStore();
$sanitizer = new DefaultParameterSanitizer();
$profiler = new RowcastProfiler($store, $sanitizer, slowQueryThresholdMs: 50.0, maxQueries: 500);

new ConnectionProfiler($inner, $profiler);
$inner->fetchOne('SELECT 1');

foreach ($store->getProfiles() as $profile) {
    echo $profile->sql, ' ', $profile->durationMs, "ms\n";
}

Symfony: enable rowcast.profiler in RowcastBundle (see bundle docs).

Packagist / versioning

The root composer.json may include a "version": "1.0.0" field so path repositories and CI resolve a stable ^1.0 constraint. Remove that field when tagging releases on GitHub/Packagist (tags define the version).

License

MIT