8p / EightPointsGuzzleBundle

⛽️ Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony
MIT License
440 stars 71 forks source link

[Profiler] Add detailed request time desc. (dns lookup, ...) #224

Open florianpreusner opened 6 years ago

florianpreusner commented 6 years ago

Based on #210:

More detailed request time description: dns lookup time, connection time, etc..

rpkamp commented 5 years ago

This sounds awesome, but where could we get that information? I've searched for a bit, but couldn't find anything on how to retrieve these timings from Guzzle.

gregurco commented 4 years ago

@rpkamp sorry for long answer. I checked and found that in RequestTimeMiddleware we're using on_stats option from guzzle. There we receive TransferStats object with handler stats info via getHandlerStats and getHandlerStat methods. That's an example of info:

Selection_033

Guzzle receives these info from curl getinfo function: https://www.php.net/manual/en/function.curl-getinfo.php

Hope it will help you :slightly_smiling_face:

More info: https://github.com/8p/EightPointsGuzzleBundle/blob/master/src/Middleware/RequestTimeMiddleware.php#L63 http://docs.guzzlephp.org/en/stable/request-options.html#on-stats https://github.com/guzzle/guzzle/blob/master/src/TransferStats.php

scion4581 commented 1 year ago

Yeah, but how to access request time in symfony log middleware, for example, to put it in log context...