pub struct Metrics { /* private fields */ }
Expand description
An object that holds status updates and progress statistics on a particular
request. A Metrics
can be shared between threads, which allows an agent
thread to post updates to the object while consumers can read from the
object simultaneously.
Reading stats is not always guaranteed to be up-to-date.
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn upload_progress(&self) -> (u64, u64)
pub fn upload_progress(&self) -> (u64, u64)
Number of bytes uploaded / estimated total.
Sourcepub fn upload_speed(&self) -> f64
pub fn upload_speed(&self) -> f64
Average upload speed so far in bytes/second.
Sourcepub fn download_progress(&self) -> (u64, u64)
pub fn download_progress(&self) -> (u64, u64)
Number of bytes downloaded / estimated total.
Sourcepub fn download_speed(&self) -> f64
pub fn download_speed(&self) -> f64
Average download speed so far in bytes/second.
Sourcepub fn name_lookup_time(&self) -> Duration
pub fn name_lookup_time(&self) -> Duration
Get the total time from the start of the request until DNS name resolving was completed.
When a redirect is followed, the time from each request is added together.
Sourcepub fn connect_time(&self) -> Duration
pub fn connect_time(&self) -> Duration
Get the amount of time taken to establish a connection to the server (not including TLS connection time).
When a redirect is followed, the time from each request is added together.
Sourcepub fn secure_connect_time(&self) -> Duration
pub fn secure_connect_time(&self) -> Duration
Get the amount of time spent on TLS handshakes.
When a redirect is followed, the time from each request is added together.
Sourcepub fn transfer_start_time(&self) -> Duration
pub fn transfer_start_time(&self) -> Duration
Get the time it took from the start of the request until the first byte is either sent or received.
When a redirect is followed, the time from each request is added together.
Sourcepub fn transfer_time(&self) -> Duration
pub fn transfer_time(&self) -> Duration
Get the amount of time spent performing the actual request transfer. The “transfer” includes both sending the request and receiving the response.
When a redirect is followed, the time from each request is added together.
Sourcepub fn total_time(&self) -> Duration
pub fn total_time(&self) -> Duration
Get the total time for the entire request. This will continuously increase until the entire response body is consumed and completed.
When a redirect is followed, the time from each request is added together.
Sourcepub fn redirect_time(&self) -> Duration
pub fn redirect_time(&self) -> Duration
If automatic redirect following is enabled, gets the total time taken for all redirection steps including name lookup, connect, pretransfer and transfer before final transaction was started.