phip1611 / ttfb

Library + CLI-Tool to measure the TTFB (time to first byte) of HTTP requests. Additionally, this crate measures the times of DNS lookup, TCP connect and TLS handshake.
MIT License
42 stars 11 forks source link

also add content download time (requires http/1.1 header parsing) #2

Open phip1611 opened 3 years ago

phip1611 commented 3 years ago

will be more complicated, because it needs HTTP header parsing.. content encoding could be chunked for example..

I need to know the contents length, because the "read_to_end" (EOF) doesn't work well. Some servers even do not send the EOF (program gets stuck)

GenericNerd commented 7 months ago

Hey there!

Firstly, great work on the library. It's been incredibly useful so far. Is there any plans to implement this feature at some point? It would complete the main HTTP timings and it would be incredibly useful :)

phip1611 commented 7 months ago

Hey. Thanks for the interest in my library.

Generally speaking, I'd love to have full HTTP/1.1, HTTP/2.0, and HTTP/3.0 support. However, for the nature of the library, I need a more low-level access to the corresponding implementations which I'm not sure yet all popular crates for HTTP 1/2/3 offer.

Further, those protocol implementations on top of the TLS stream need to provide me with the following functionality:

I think it might be possible if the corresponding protocol libraries offer the proper abstractions. I try looking into it in the next 14 days.

GenericNerd commented 6 months ago

Hiya there! Any updates?

phip1611 commented 6 months ago

I'm sorry to tell you that, but I do not have the capacity to work on this, at least in the next two months.

I'm open for (good) pull requests/contributions tho.

I think a way forward is to properly implement a Http/1.1, HTTP/2, and HTTP/3 (see #35) API adapter compatible with the current connector-style code. This adapter must enable it to load the first byte separately from the full resource.