You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make .elapsed reflect the entire response time. #655
I think we should probably switch the behavior of .elapsed so that rather than reflecting the "time for the response to start", it is instead only available once .close() has been called, and is calculated from the start of the request to the point that the response is closed.
That way it'll actually properly reflect the time taken for the entire request/response cycle.
Activity
lovelydinosaur commentedon Dec 20, 2019
Two different options here during streaming responses...
.elapsedis not available until the response is closed..elapsedis available, but will reflect "elapsed so far", until the response is finally closed.I guess we probably just want to go with the former, as a more constrained option.
[-]Make `.elapsed` reflect the entire request time.[/-][+]Make `.elapsed` reflect the entire response time.[/+]lovelydinosaur commentedon Dec 20, 2019
We'll also want to note in the requests compat that our
.elapsedproperty is different to requests. (Which I assume uses time-to-start-response?)See encode/httpx#655