EightPointsGuzzleBundle icon indicating copy to clipboard operation
EightPointsGuzzleBundle copied to clipboard

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

Open florianpreusner opened this issue 6 years ago • 3 comments

Based on #210:

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

florianpreusner avatar Oct 09 '18 12:10 florianpreusner

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.

rpkamp avatar Oct 18 '19 08:10 rpkamp

@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

gregurco avatar Oct 31 '19 09:10 gregurco

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

scion4581 avatar Apr 06 '23 01:04 scion4581