Package

Christophrumpel Artisan Benchmark

Benchmark Artisan Commands

Package

christophrumpel/artisan-benchmark

View on GitHub →

(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. After execution, you'll see detailed benchmark results.

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

php artisan benchmark

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.

Technical Details

Query Count

The package uses Laravel's query logging functionality to track the number of database queries:

DB::enableQueryLog();
DB::flushQueryLog();

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.

Christophrumpel Artisan Benchmark Related Articles

Artisan Benchmark image

Artisan Benchmark

Read article

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

Pushsilver

Pushsilver is simple invoicing for freelancers and small studios — send polished invoices, automate reminders, and get paid on time without the bloat.

Pushsilver

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing