[−][src]Struct open_metrics_client::registry::Registry
A metric registry to register metrics with, later on passed to an encoder collecting samples of each metric by iterating all metrics in the registry.
let mut registry = Registry::<Box<dyn EncodeMetric>>::new(); let counter = Counter::<AtomicU64>::new(); let gauge= Gauge::<AtomicU64>::new(); registry.register( Descriptor::new("counter", "This is my counter.", "my_counter"), Box::new(counter.clone()), ); registry.register( Descriptor::new("gauge", "This is my gauge.", "my_gauge"), Box::new(gauge.clone()), );
Implementations
impl<M> Registry<M>[src]
pub fn new() -> Self[src]
pub fn register(&mut self, desc: Descriptor, metric: M)[src]
pub fn iter(&self) -> impl Iterator<Item = &(Descriptor, M)>[src]
Auto Trait Implementations
impl<M> RefUnwindSafe for Registry<M> where
M: RefUnwindSafe, [src]
M: RefUnwindSafe,
impl<M> Send for Registry<M> where
M: Send, [src]
M: Send,
impl<M> Sync for Registry<M> where
M: Sync, [src]
M: Sync,
impl<M> Unpin for Registry<M> where
M: Unpin, [src]
M: Unpin,
impl<M> UnwindSafe for Registry<M> where
M: UnwindSafe, [src]
M: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Erased for T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,