clarkeash / laravel-http-stats
获取您HTTP请求的统计数据
v1.0.0
2020-04-04 20:12 UTC
Requires
- php: ^7.3
- guzzlehttp/guzzle: ^6.5
- laravel/framework: ^7.0
Requires (Dev)
- orchestra/testbench: ^5.1
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-08-29 22:40:27 UTC
README
Laravel Http Stats 允许您访问通过Laravel的 HTTP客户端 执行的HTTP统计传输数据。
安装
您可以使用 composer 来引入此包
$ composer require clarkeash/laravel-http-stats
用法
一旦您发出类似以下请求
use Illuminate\Support\Facades\Http; $response = Http::get('http://test.com');
现在您将能够访问 $response
对象上的 stats
方法。
$response->stats()->lookup(); // dns time in ms $response->stats()->connect(); // tcp connection time in ms $response->stats()->ssl(); // ssl handshake time in ms $response->stats()->pretransfer(); // Protocol negotiation time in ms $response->stats()->redirect(); // redirect time in ms $response->stats()->ttfb(); // time to first byte in ms $response->stats()->total(); // total time in ms