pub struct UpstreamMetrics { /* private fields */ }Expand description
Aggregate metrics for an super::UpstreamProxy instance.
Tracks connection and request counts across all targets, and provides
access to per-target metrics via UpstreamMetrics::get and UpstreamMetrics::for_each.
Implementations§
Source§impl UpstreamMetrics
impl UpstreamMetrics
Sourcepub fn denied_requests(&self) -> u64
pub fn denied_requests(&self) -> u64
Returns the total number of denied requests across all targets.
Sourcepub fn accepted_requests(&self) -> u64
pub fn accepted_requests(&self) -> u64
Returns the total number of accepted requests across all targets.
Sourcepub fn active_requests(&self) -> u64
pub fn active_requests(&self) -> u64
Returns the estimated number of currently in-flight requests.
Uses saturating arithmetic since counters are read non-atomically.
Sourcepub fn active_iroh_connections(&self) -> u64
pub fn active_iroh_connections(&self) -> u64
Returns the estimated number of currently open iroh connections.
Uses saturating arithmetic since counters are read non-atomically.
Sourcepub fn total_iroh_connections(&self) -> u64
pub fn total_iroh_connections(&self) -> u64
Returns the total number of iroh connections ever accepted.
Sourcepub fn get(&self, target: &Authority) -> Option<Arc<TargetMetrics>>
pub fn get(&self, target: &Authority) -> Option<Arc<TargetMetrics>>
Returns the per-target metrics for target, if any requests have been made to it.
Sourcepub fn for_each(&self, f: impl Fn(&Authority, &TargetMetrics))
pub fn for_each(&self, f: impl Fn(&Authority, &TargetMetrics))
Calls f for each tracked target and its metrics.
Holds a read lock on the target map for the duration of the call.
Trait Implementations§
Source§impl Debug for UpstreamMetrics
impl Debug for UpstreamMetrics
Source§impl Default for UpstreamMetrics
impl Default for UpstreamMetrics
Source§fn default() -> UpstreamMetrics
fn default() -> UpstreamMetrics
Auto Trait Implementations§
impl !Freeze for UpstreamMetrics
impl RefUnwindSafe for UpstreamMetrics
impl Send for UpstreamMetrics
impl Sync for UpstreamMetrics
impl Unpin for UpstreamMetrics
impl UnsafeUnpin for UpstreamMetrics
impl UnwindSafe for UpstreamMetrics
Blanket Implementations§
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
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>
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>
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