pub struct Registry { /* private fields */ }
Expand description
A registry for MetricsGroup
.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn sub_registry_with_prefix(
&mut self,
prefix: impl Into<Cow<'static, str>>,
) -> &mut Self
pub fn sub_registry_with_prefix( &mut self, prefix: impl Into<Cow<'static, str>>, ) -> &mut Self
Creates a subregistry where all metrics are prefixed with prefix
.
Returns a mutable reference to the subregistry.
Sourcepub fn sub_registry_with_labels(
&mut self,
labels: impl IntoIterator<Item = (impl Into<Cow<'static, str>>, impl Into<Cow<'static, str>>)>,
) -> &mut Self
pub fn sub_registry_with_labels( &mut self, labels: impl IntoIterator<Item = (impl Into<Cow<'static, str>>, impl Into<Cow<'static, str>>)>, ) -> &mut Self
Creates a subregistry where all metrics are labeled.
Returns a mutable reference to the subregistry.
Sourcepub fn sub_registry_with_label(
&mut self,
key: impl Into<Cow<'static, str>>,
value: impl Into<Cow<'static, str>>,
) -> &mut Self
pub fn sub_registry_with_label( &mut self, key: impl Into<Cow<'static, str>>, value: impl Into<Cow<'static, str>>, ) -> &mut Self
Creates a subregistry where all metrics have a key=value
label.
Returns a mutable reference to the subregistry.
Sourcepub fn register(&mut self, metrics_group: Arc<dyn MetricsGroup>)
pub fn register(&mut self, metrics_group: Arc<dyn MetricsGroup>)
Registers a MetricsGroup
into this registry.
Sourcepub fn register_all(&mut self, metrics_group_set: &impl MetricsGroupSet)
pub fn register_all(&mut self, metrics_group_set: &impl MetricsGroupSet)
Registers a MetricsGroupSet
into this registry.
Sourcepub fn register_all_prefixed(
&mut self,
metrics_group_set: &impl MetricsGroupSet,
)
pub fn register_all_prefixed( &mut self, metrics_group_set: &impl MetricsGroupSet, )
Registers a MetricsGroupSet
into this registry, prefixing all metrics with the group set’s name.
Trait Implementations§
Source§impl MetricsSource for Registry
impl MetricsSource for Registry
Auto Trait Implementations§
impl Freeze for Registry
impl !RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl !UnwindSafe for Registry
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