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
PHP 7.0 & HHVM Benchmark image

PHP 7.0 & HHVM Benchmark

Read article
Quickly test the performance of your Laravel app with the Benchmarking helper image

Quickly test the performance of your Laravel app with the Benchmarking helper

Read article
Laravel Factories Reloaded image

Laravel Factories Reloaded

Read article
Performance Analysis with Laravel's Measurement Tools image

Performance Analysis with Laravel's Measurement Tools

Read article
Laravel 10.20 Released image

Laravel 10.20 Released

Read article

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

Let your users buy domains without leaving your app

If your Laravel app gives users a site, a storefront, or a workspace, they’ll eventually want their own domain. The name.com API lets them search, register, and connect one without leaving your product. It’s a clean REST API, so Laravel’s HTTP client is all you need.

Let your users buy domains without leaving your app

PhpStorm

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

PhpStorm

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift

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