Skip to content

response.elapsed now reflects entire request/response time. - #692

Merged
lovelydinosaur merged 6 commits into
masterfrom
gdhameeja-Fix-655
Dec 29, 2019
Merged

response.elapsed now reflects entire request/response time.#692
lovelydinosaur merged 6 commits into
masterfrom
gdhameeja-Fix-655

Conversation

@lovelydinosaur

@lovelydinosaurlovelydinosaur commented Dec 29, 2019

Copy link
Copy Markdown
Contributor

Couple of further tweaks on top of #687, with thanks to @gdhameeja

  • Response(content=...) is a closed response and should have response.elapsed == datetime.timedelta(0).
  • ._elapsed should only be set when the response is closed. Any further calls to .close should have no effect.

Closes #655

@lovelydinosaurlovelydinosaur added this to the 0.10.0 milestone Dec 29, 2019
Comment threadhttpx/models.py Outdated
This was referenced Dec 29, 2019

@florimondmancaflorimondmanca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lovelydinosaur
lovelydinosaur merged commit 6a1ee0e into masterDec 29, 2019
@lovelydinosaur
lovelydinosaur deleted the gdhameeja-Fix-655 branch December 29, 2019 16:56
Kludex referenced this pull request in pydantic/httpx2 May 11, 2026
* Use conditional imports of trio and anyio
* Update CHANGELOG
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Make .elapsed reflect the entire response time.

2 participants

@lovelydinosaur@florimondmanca