iroh_metrics

Trait MetricsGroupSet

Source
pub trait MetricsGroupSet {
    // Required methods
    fn name(&self) -> &'static str;
    fn groups(&self) -> impl Iterator<Item = &dyn MetricsGroup>;

    // Provided methods
    fn iter(&self) -> impl Iterator<Item = (&'static str, MetricItem<'_>)> { ... }
    fn register(&self, registry: &mut Registry) { ... }
}
Expand description

Trait for a set of structs implementing MetricsGroup.

Required Methods§

Source

fn name(&self) -> &'static str

Returns the name of this metrics group set.

Source

fn groups(&self) -> impl Iterator<Item = &dyn MetricsGroup>

Returns an iterator over the MetricsGroup in this struct.

Provided Methods§

Source

fn iter(&self) -> impl Iterator<Item = (&'static str, MetricItem<'_>)>

Returns an iterator over all metrics in this metrics group set.

The iterator yields tuples of (&str, MetricItem). The &str is the group name.

Source

fn register(&self, registry: &mut Registry)

Available on crate feature metrics only.

Register all metrics groups in this set onto a prometheus client registry.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§