[Laravel 扩展库]Laravel Artisan 基准测试

Laravel 核心团队成员 Christoph Rumpel 最近在视频上演示了一个名为 Artisan Benchmark 的新扩展包。这个包允许你对 Artisan 命令进行基准测试,以获取各种指标,如:
- 执行时间
- 内存使用
- SQL 查询计数
- 返回/影响的行数
你可以通过 Composer 安装这个包:
composer require christophrumpel/artisan-benchmark
然后,对命令进行基准测试:
php artisan benchmark your:command
如果你未传递命令作为参数,它将展示可用的命令列表。
注意:此包仅跟踪通过 Eloquent 或查询生成器执行的查询的查询计数。
Github 源码:https://github.com/christophrumpel/artisan-benchmark