Expand description
Metrics and descriptions for the given request-response cycle.
§Examples
use http_types::Response;
use http_types::trace::{ServerTiming, Metric};
let mut timings = ServerTiming::new();
timings.push(Metric::new("server".to_owned(), None, None)?);
let mut res = Response::new(200);
timings.apply(&mut res);
let timings = ServerTiming::from_headers(res)?.unwrap();
let entry = timings.iter().next().unwrap();
assert_eq!(entry.name(), "server");
Structs§
- A borrowing iterator over entries in
ServerTiming
. - A lending iterator over entries in
ServerTiming
. - A mutable iterator over entries in
ServerTiming
. - An individual entry into
ServerTiming
. - Metrics and descriptions for the given request-response cycle.