y-ui / laravel-running-time
基于 Laravel 的请求执行时间统计工具
v1.1.5
2020-08-24 10:36 UTC
Requires
- php: >=7.0.0
- predis/predis: ^1.1
Requires (Dev)
- php: >=7.0.0
- predis/predis: ^1.1
README
安装
composer require y-ui/laravel-running-time ^1.1
配置
-
打开您的
app/Http/Kernel.php
文件,并将以下内容添加到$middleware
数组中\RunningTime\Middleware\RunningTimeMiddleware::class,
-
运行以下命令以发布包配置文件
config/runningtime.php
php 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 许可下授权的开源软件。