christophrumpel/
artisan-benchmark
g4t.io

Artisan Benchmark

19 views 184 stars by Yannick Lyn Fatt

Benchmark Artisan Commands

README from christophrumpel/artisan-benchmark Open on GitHub →

CleanShot 2025-02-08 at 17 56 49 3@2x

(Part of the video Import One Million Rows To The Database (PHP/Laravel))

Artisan Benchmark

Installation

composer require christophrumpel/artisan-benchmark

Usage

This package lets you benchmark your artisan commands:

php artisan benchmark your:command

Simply replace ⁠your:command with your command signature.

To provide arguments and options, use quotes to wrap the command signature:

php artisan benchmark "your:command --with-option"

After execution, you'll see detailed benchmark results.

CleanShot 2025-02-08 at 17 56 49@2x

If you run the command without a signature, it will display a list of available commands to choose from:

php artisan benchmark

CleanShot 2025-02-14 at 13 21 14@2x

Table Count Monitoring

You can monitor changes in a specific database table's record count by using the ⁠--tableToWatch option:

php artisan benchmark your:command --tableToWatch=users

Be aware that it only shows the count difference from before running your command.

CleanShot 2025-02-14 at 13 34 31@2x

Technical Details

Query Count

The package uses a listener on the Laravel database event Illuminate\Database\Events\QueryExecuted to track the number of database queries.

If events are disabled in your application, queries will not be counted.

Please note that this only tracks queries executed through Eloquent or the Query Builder. Direct database queries will not be counted. Contributions for improving this functionality are welcome.

More from the ecosystem

durable-workflow/
workflow
g4t.io
9 1,292

Durable Workflow: Long-Running Workflows for Laravel

Embedded durable workflow runtime and orchestration engine for Laravel applications.

durable-workflow/workflow via Laravel News
packstub/
session-replay
g4t.io
14 52

Session Replay for Laravel: Self-Hosted Browser Recordings

Session replay for Laravel: record what a person did in the browser with rrweb, keep the recording on your own disk and database, and watch it behind a gate you define — masked inputs by default, errors, failed Livewire requests and web vitals marked on the timeline, a link to the replay in every log line. packstub/filament-session-replay adds the sessions to a Filament panel.

packstub/session-replay via Laravel News
cyberwizard-dev/
schedule-catchup
g4t.io
17

Replay Missed Laravel Scheduled Tasks With Schedule Catchup

Schedule Catchup replays missed Laravel scheduled tasks after downtime, with opt-in recovery, bounded retries, and access to the original scheduled date.

cyberwizard-dev/schedule-catchup via Laravel News