Crates.io | http-timings |
lib.rs | http-timings |
version | 0.1.4 |
source | src |
created_at | 2024-04-12 19:54:42.941334 |
updated_at | 2024-10-25 23:24:07.763969 |
description | A simple library to measure the key HTTP timings from the development tools |
homepage | |
repository | https://github.com/down-watch/http-timings |
max_upload_size | |
id | 1206824 |
size | 18,710 |
Inspired by the TTFB library by phip1611. The HTTP timings provided by this library are as follows:
As well as this timing, this library also provides the following information about each request:
use http_timings::request_url;
if let Ok(timings) = request_url("https://www.google.com") {
println!("{:?}", timings);
}
/// Output:
/// RequestOutput {
/// status: 200,
/// timings: RequestTimings {
/// dns: 19.121396ms,
/// tcp: 42.066481ms,
/// tls: Some(29.665676ms),
/// http_send: 8.977µs,
/// ttbf: 101.531718ms,
/// content_download: 2.268473ms
/// },
/// body: "<!doctype html>..."
/// }
The RequestOutput
struct provides the timings in both relative and total terms. The relative timings are the time taken for each step of the request, while the total timings are the time taken from the start of the request to the end of the request.
The URL input can be any valid website as well as any valid IP.