christophrumpel/artisan-benchmark
最新稳定版本:v0.0.4
Composer 安装命令:
composer require christophrumpel/artisan-benchmark
包简介
Benchmark Artisan Commands
README 文档
README
(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.
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 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.
统计信息
- 总下载量: 50.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 178
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-14