Trait NodeMetricManager

Source
pub trait NodeMetricManager: MetricManager {
    // Provided methods
    fn init(&self, _handle: &NodeHandle) { ... }
    fn on_ncmd<'life0, 'async_trait>(
        &'life0 self,
        _node: NodeHandle,
        _metrics: MessageMetrics,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A trait for implementing a type that defines node-specific metrics

Provided Methods§

Source

fn init(&self, _handle: &NodeHandle)

Initialise the struct.

Called when the Node is created

Source

fn on_ncmd<'life0, 'async_trait>( &'life0 self, _node: NodeHandle, _metrics: MessageMetrics, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Processes NCMD metrics.

This async method is called when a NCMD message for the node is received, allowing the implementation to handle command metrics as it sees fit. The default implementation does nothing.

Implementors§