pub struct ConnectionMetrics { /* private fields */ }Expand description
Connection metrics
Implementations§
Source§impl ConnectionMetrics
impl ConnectionMetrics
Sourcepub fn connection_established(&self, inbound: bool)
pub fn connection_established(&self, inbound: bool)
Record a connection established
Sourcepub fn connection_closed(&self, duration: Duration)
pub fn connection_closed(&self, duration: Duration)
Record a connection closed
Sourcepub fn connection_failed(&self)
pub fn connection_failed(&self)
Record a connection failure
Sourcepub fn total_established(&self) -> u64
pub fn total_established(&self) -> u64
Get total connections established
Sourcepub fn total_failed(&self) -> u64
pub fn total_failed(&self) -> u64
Get total connections failed
Sourcepub fn total_inbound(&self) -> u64
pub fn total_inbound(&self) -> u64
Get inbound connection count
Sourcepub fn total_outbound(&self) -> u64
pub fn total_outbound(&self) -> u64
Get outbound connection count
Sourcepub fn avg_duration(&self) -> Option<Duration>
pub fn avg_duration(&self) -> Option<Duration>
Get average connection duration
Sourcepub fn snapshot(&self) -> ConnectionMetricsSnapshot
pub fn snapshot(&self) -> ConnectionMetricsSnapshot
Get snapshot
Auto Trait Implementations§
impl !Freeze for ConnectionMetrics
impl !RefUnwindSafe for ConnectionMetrics
impl Send for ConnectionMetrics
impl Sync for ConnectionMetrics
impl Unpin for ConnectionMetrics
impl UnwindSafe for ConnectionMetrics
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more