pub struct EndpointMetrics { /* private fields */ }Expand description
Lock-free metric counters for Steam endpoint calls.
Lives in a LazyLock<EndpointMetrics> (see metrics). Counters are
atomic so any task can record_call without contention. Snapshots can be
taken at any time via EndpointMetrics::snapshot.
Indexing scheme: fixed-size 2D array [Host][EndpointKind] keyed by the
enum’s as usize discriminant. Iteration order matches enum
declaration order. Status codes are not tracked here — they belong on
the tracing layer (http.status_code field).
Implementations§
Source§impl EndpointMetrics
impl EndpointMetrics
Sourcepub fn record_call(&self, ep: &EndpointInfo)
pub fn record_call(&self, ep: &EndpointInfo)
Record one call against the given endpoint. Cheap; uses Relaxed
ordering since these are counters, not synchronisation primitives.
Sourcepub fn snapshot(&self) -> EndpointMetricsSnapshot
pub fn snapshot(&self) -> EndpointMetricsSnapshot
Snapshot all counters. Atomic loads only — never blocks writers.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EndpointMetrics
impl RefUnwindSafe for EndpointMetrics
impl Send for EndpointMetrics
impl Sync for EndpointMetrics
impl Unpin for EndpointMetrics
impl UnsafeUnpin for EndpointMetrics
impl UnwindSafe for EndpointMetrics
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
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