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.