mtolhuys/laravel-request-benchmark
Composer 安装命令:
composer require mtolhuys/laravel-request-benchmark
包简介
Configurable middleware measuring your request's time and memory usage
README 文档
README
This package comes with a benchmark middleware which, if included, will measure your requests time and memory usage.
Installation
You can install the package via composer:
composer require mtolhuys/laravel-request-benchmark
Usage
Add the 'benchmark' middleware to the routes you want to measure f.e.:
Route::group(['middleware' => ['foo', 'bar', 'benchmark']], function() { // benchmarked routes }); // Or Route::get('/', 'IndexController@index')->middleware('benchmark');
Out of the box this will create debug log entries f.e.:
[yyyy-mm-dd hh:mm:ss] local.DEBUG: request-benchmark: GET[http://localhost]
Time: 1.05ms
Pre memory usage 3169Kb
Post memory usage 3296Kb (127Kb)
As well as a overview page on route /request-benchmark containing a table showing the results stored in request-benchmark.json file.
This behavior is configurable with the included request-benchmark config file.
Run php artisan vendor:publish --provider="Mtolhuys\LaravelRequestBenchmark\LaravelRequestBenchmarkServiceProvider" if you don't see it in your config/ folder.
return [ 'enabled' => true, // set to false to globally stop benchmark 'log' => true, // set to false to stop creating log entries 'storage_path' => null, // if specified it will create a request-benchmark.json containing all data ];
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email mtolhuys@hotmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 31
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-03