Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Artisan Benchmark

Artisan Benchmark stats

Downloads
3
Stars
24
Open Issues
0
Forks
1

View on GitHub →

Benchmark Artisan Commands

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

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Christophrumpel Artisan Benchmark Related Articles

Artisan Benchmark image

Artisan Benchmark

Read article
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
DreamzTech logo

DreamzTech

Hire 6-10+ Yrs. experienced skilled Laravel Developers from DreamzTech. We ensure NDA protected, 100% quality delivery. Contact Us & Discuss Your Need.

DreamzTech
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge