pub struct Scope { /* private fields */ }Expand description
Supports creation of scoped metrics.
Scopes may be cloned without copying the underlying metrics registry.
Labels may be attached to the scope so that all metrics created by the Scope are
labeled.
Implementations§
Source§impl Scope
impl Scope
Sourcepub fn labeled<D: Display>(self, k: &'static str, v: D) -> Self
pub fn labeled<D: Display>(self, k: &'static str, v: D) -> Self
Adds a label into scope (potentially overwriting).
Sourcepub fn stat(&self, name: &'static str) -> Stat
pub fn stat(&self, name: &'static str) -> Stat
Creates a Stat with the given name.
The underlying histogram is automatically resized as values are added.
pub fn timer_us(&self, name: &'static str) -> Timer
pub fn timer_ms(&self, name: &'static str) -> Timer
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
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