pub struct Metrics { /* private fields */ }
Expand description
Set of Swarm and protocol metrics derived from emitted events.
Implementations
sourceimpl Metrics
impl Metrics
sourcepub fn new(
registry: &mut Registry<Box<dyn SendEncodeMetric + 'static, Global>>
) -> Metrics
pub fn new(
registry: &mut Registry<Box<dyn SendEncodeMetric + 'static, Global>>
) -> Metrics
Create a new set of Swarm and protocol Metrics
.
use prometheus_client::registry::Registry;
use libp2p_metrics::Metrics;
let mut registry = Registry::default();
let metrics = Metrics::new(&mut registry);
Trait Implementations
sourceimpl Recorder<GossipsubEvent> for Metrics
impl Recorder<GossipsubEvent> for Metrics
sourcefn record(&self, event: &GossipsubEvent)
fn record(&self, event: &GossipsubEvent)
Record the given event.
sourceimpl Recorder<IdentifyEvent> for Metrics
impl Recorder<IdentifyEvent> for Metrics
sourcefn record(&self, event: &IdentifyEvent)
fn record(&self, event: &IdentifyEvent)
Record the given event.
sourceimpl Recorder<KademliaEvent> for Metrics
impl Recorder<KademliaEvent> for Metrics
sourcefn record(&self, event: &KademliaEvent)
fn record(&self, event: &KademliaEvent)
Record the given event.
sourceimpl<TBvEv, THandleErr> Recorder<SwarmEvent<TBvEv, THandleErr>> for Metrics
impl<TBvEv, THandleErr> Recorder<SwarmEvent<TBvEv, THandleErr>> for Metrics
sourcefn record(&self, event: &SwarmEvent<TBvEv, THandleErr>)
fn record(&self, event: &SwarmEvent<TBvEv, THandleErr>)
Record the given event.
Auto Trait Implementations
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more