Metrics

Trait Metrics 

Source
pub trait Metrics: Send + Sync {
    // Required methods
    fn initialize<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn flush<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_gauge<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        value: f64,
    ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn increment_counter<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        value: u64,
    ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_histogram<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        value: f64,
    ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Pluggable metrics backend used by the indexing pipeline.

Implementors should make methods non-blocking and resilient to backpressure. Errors should be rare and indicate misconfiguration.

Required Methods§

Source

fn initialize<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update_gauge<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, value: f64, ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set a gauge to the provided value.

Source

fn increment_counter<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, value: u64, ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Increment a counter by the provided amount.

Source

fn record_histogram<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, value: f64, ) -> Pin<Box<dyn Future<Output = IndexerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record a single value into a histogram.

Implementors§