chen-see / laravel-running-time
基于 Laravel 的请求执行时间统计工具
v1.1.7
2023-07-31 03:14 UTC
Requires
- php: >=7.0.0
- predis/predis: ^1.1
Requires (Dev)
- php: >=7.0.0
- predis/predis: ^1.1
This package is auto-updated.
Last update: 2024-09-30 01:38:11 UTC
README
安装
composer require y-ui/laravel-running-time ^1.1
配置
-
打开你的
app/Http/Kernel.php文件,并将以下内容添加到$middleware数组中\RunningTime\Middleware\RunningTimeMiddleware::class,
-
运行以下命令以发布包配置文件
config/runningtime.phpphp artisan vendor:publish --provider='RunningTime\RunningTimeServiceProvider'
-
如果你想以批处理模式运行,这需要 Redis。打开你的
config/runningtime.php'mode' => 'delay',
-
如果运行命令后内存不足,打开你的
config/runningtime.php'memory_limit' => '512M', //Modify to the appropriate value
或者使用
--lessMemory标志运行命令
使用方法
简单用法
#This will count the last 7 days of data php artisan running-time #This will show the top 20 path php artisan running-time --line=20 php artisan running-time --start=2019-03-03 php artisan running-time --start='1 month ago' php artisan running-time --path='your path' #Significantly reduce memory usage but increase time spent php artisan running-time --lessMemory
选项
--line Maximum number of displayed lines
--start Statistical start time
--end Statistical end time
--path Statistical path runtime
--lessMemory Significantly reduce memory usage and increase time spent
清理日志文件
简单用法
php artisan running-time:clear --all php artisan running-time:clear --recent=30
待办事项列表
- 网页
许可协议
laravel-running-time 是一个开源软件,许可协议为 MIT 许可。
