Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Support timing output similar to Curl's -w option #122

Open
marklap opened this Issue Jan 11, 2013 · 8 comments

Comments

Projects
None yet
8 participants

aseemk commented Sep 6, 2014

I'd love to see this, and came here just to file this request.

I personally don't need anything fancy. Just simple timing would be great. (With a way to see only timing, and not the full response body. Perhaps group it with response headers?)

In my case, my colleague discovered that time http ... was super inaccurate, because just running http added several hundred milliseconds. We now do time curl ....

(@marklap: didn't know about the -w argument to curl, thanks. As mentioned, in our case, we want to suppress the response body though, as it's heavy, and we're only interested in the time. Do you know any way to achieve that?)

Every response from requests has an elapsed attribute that shows the time it took to make the request. Currently 2.3.0 and 2.4.0 only show the time for the initial response, not the time it takes to download the entire response (in the case where the user does not want to stream the body, which is every case in httpie if I understand correctly). There's a bug report for that right now. The -w option would be as easy as printing response.elapsed.

This was referenced Sep 8, 2014

GuiSim commented Sep 10, 2015

Any progress on this feature?

Also interested in having some basic way of getting the total request+response time

svagi commented Sep 23, 2015

+1

marklap commented Sep 27, 2015

I threw this together for fun. It's not awesome but it works and I think it's a bit more accurate than some other attempts (or suggestions).

https://github.com/marklap/httpie-timing

netroby commented Dec 25, 2015

  • 1

doc commented Feb 1, 2017

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment