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
sourceimpl Metrics
impl Metrics
sourcepub fn upload_speed(&self) -> f64
pub fn upload_speed(&self) -> f64
Average upload speed so far in bytes/second.
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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more