This does not allow requests to be used for performance measurements where we want to more accurately measure how much time did it take for a server to render a response.
And it eventually does performs the request sending through urllib3. It seems this feature would require changing urllib3 logic to allow for getting this timing properly.
Hi,
It would be awesome if requests allowed for getting the time to first byte metric. Currently, there is the
response.elapsed.total_seconds()
metric but it computes the time for both sending the request and receiving a response: https://github.com/psf/requests/blob/a3ce6f007597f14029e6b6f54676c34196aa050e/src/requests/sessions.py#L699-L707This does not allow requests to be used for performance measurements where we want to more accurately measure how much time did it take for a server to render a response.
The request sending goes over an adapter
.send
method here: https://github.com/psf/requests/blob/a3ce6f007597f14029e6b6f54676c34196aa050e/src/requests/adapters.py#L613-L719And it eventually does performs the request sending through urllib3. It seems this feature would require changing urllib3 logic to allow for getting this timing properly.