pub struct Metrics { /* private fields */ }Expand description
Lightweight counters for pool/queue backpressure.
§Example
use styx_core::metrics::Metrics;
let metrics = Metrics::default();
metrics.hit();
assert_eq!(metrics.hits(), 1);Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn backpressure(&self)
pub fn backpressure(&self)
Increment backpressure counter.
Sourcepub fn allocations(&self) -> u64
pub fn allocations(&self) -> u64
Snapshot of allocations.
Sourcepub fn backpressure_count(&self) -> u64
pub fn backpressure_count(&self) -> u64
Snapshot of backpressure events.
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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