pub struct MetricsRegistry { /* private fields */ }Expand description
Global registry of named counters and histograms. Indexed by static string keys; lookups are O(log N) on a BTreeMap. Lock is only held during register/lookup, not during increment.
Implementations§
Source§impl MetricsRegistry
impl MetricsRegistry
Sourcepub fn register_counter(&self, name: &'static str, c: &'static Counter)
pub fn register_counter(&self, name: &'static str, c: &'static Counter)
Register a 'static counter so it shows up in
snapshot(). Idempotent — re-registering with the same
pointer is a no-op.
pub fn register_histogram(&self, name: &'static str, h: &'static Histogram)
Auto Trait Implementations§
impl !Freeze for MetricsRegistry
impl RefUnwindSafe for MetricsRegistry
impl Send for MetricsRegistry
impl Sync for MetricsRegistry
impl Unpin for MetricsRegistry
impl UnsafeUnpin for MetricsRegistry
impl UnwindSafe for MetricsRegistry
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> 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