pub struct ScopedRegistry<'a> { /* private fields */ }Expand description
View into a Registry that prepends a fixed prefix to every metric
name. Created via Registry::scoped.
Available since v0.9.5.
Implementations§
Source§impl<'a> ScopedRegistry<'a>
impl<'a> ScopedRegistry<'a>
Sourcepub fn describe_counter(
&self,
name: &str,
help: impl Into<Cow<'static, str>>,
unit: Unit,
)
pub fn describe_counter( &self, name: &str, help: impl Into<Cow<'static, str>>, unit: Unit, )
Describe a counter under the scoped name.
Sourcepub fn describe_gauge(
&self,
name: &str,
help: impl Into<Cow<'static, str>>,
unit: Unit,
)
pub fn describe_gauge( &self, name: &str, help: impl Into<Cow<'static, str>>, unit: Unit, )
Describe a gauge under the scoped name.
Sourcepub fn describe_timer(
&self,
name: &str,
help: impl Into<Cow<'static, str>>,
unit: Unit,
)
pub fn describe_timer( &self, name: &str, help: impl Into<Cow<'static, str>>, unit: Unit, )
Describe a timer under the scoped name.
Sourcepub fn describe_rate(
&self,
name: &str,
help: impl Into<Cow<'static, str>>,
unit: Unit,
)
pub fn describe_rate( &self, name: &str, help: impl Into<Cow<'static, str>>, unit: Unit, )
Describe a rate meter under the scoped name.
Sourcepub fn describe_histogram(
&self,
name: &str,
help: impl Into<Cow<'static, str>>,
unit: Unit,
)
pub fn describe_histogram( &self, name: &str, help: impl Into<Cow<'static, str>>, unit: Unit, )
Describe a histogram under the scoped name.
Sourcepub fn counter(&self, name: &str) -> Arc<Counter>
pub fn counter(&self, name: &str) -> Arc<Counter>
Counter under the scoped name. Requires count.
Sourcepub fn counter_with(&self, name: &str, labels: &LabelSet) -> Arc<Counter>
pub fn counter_with(&self, name: &str, labels: &LabelSet) -> Arc<Counter>
Labeled counter under the scoped name. Requires count.
Sourcepub fn gauge_with(&self, name: &str, labels: &LabelSet) -> Arc<Gauge>
pub fn gauge_with(&self, name: &str, labels: &LabelSet) -> Arc<Gauge>
Labeled gauge under the scoped name. Requires gauge.
Sourcepub fn timer_with(&self, name: &str, labels: &LabelSet) -> Arc<Timer>
pub fn timer_with(&self, name: &str, labels: &LabelSet) -> Arc<Timer>
Labeled timer under the scoped name. Requires timer.
Sourcepub fn scoped(&self, sub_prefix: impl Into<String>) -> ScopedRegistry<'a>
pub fn scoped(&self, sub_prefix: impl Into<String>) -> ScopedRegistry<'a>
Nested scope: scoped("a.").scoped("b.") is equivalent to
scoped("a.b."). Allocates a single fresh String.
Auto Trait Implementations§
impl<'a> Freeze for ScopedRegistry<'a>
impl<'a> RefUnwindSafe for ScopedRegistry<'a>
impl<'a> Send for ScopedRegistry<'a>
impl<'a> Sync for ScopedRegistry<'a>
impl<'a> Unpin for ScopedRegistry<'a>
impl<'a> UnsafeUnpin for ScopedRegistry<'a>
impl<'a> UnwindSafe for ScopedRegistry<'a>
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