pub struct Metrics { /* private fields */ }Expand description
Live, lock-free counters a proxy increments as it serves data-plane requests. Cheap enough to update on every request (three relaxed atomic adds); the snapshot is taken on demand when an agent scrapes.
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn record(&self, ok: bool)
pub fn record(&self, ok: bool)
Records one completed data-plane request and whether it succeeded (a 2xx
response). Introspection requests (/debug/*, /metrics) are not counted,
this measures the proxy’s actual proxying.
Sourcepub fn snapshot(&self, pools: Vec<PoolSnapshot>) -> StatsSnapshot
pub fn snapshot(&self, pools: Vec<PoolSnapshot>) -> StatsSnapshot
Builds a serializable snapshot from the current counters and the supplied per-cluster pool readout (gathered by the caller, which owns the sink).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
impl UnwindSafe for Metrics
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