pub trait Metrics: Send + Sync {
// Required methods
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + 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 = CarbonResult<()>> + 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 = CarbonResult<()>> + 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 = CarbonResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Required Methods§
Sourcefn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initializes the metrics system, preparing it for data collection.
Sourcefn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Flushes any buffered metrics data to ensure all metrics are reported.
Sourcefn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Shuts down the metrics system, performing cleanup and ensuring all data is flushed.
Sourcefn update_gauge<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
value: f64,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_gauge<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
value: f64,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Updates a gauge metric, setting its value to represent the current state.
§Parameters
name
: The name of the gauge metric to update.value
: The current value of the gauge metric.
Sourcefn increment_counter<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
value: u64,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + 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 = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Increments a counter metric by a specified value.
§Parameters
name
: The name of the counter metric to increment.value
: The amount by which to increment the counter.
Sourcefn record_histogram<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
value: f64,
) -> Pin<Box<dyn Future<Output = CarbonResult<()>> + 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 = CarbonResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Records a value in a histogram metric, representing distribution data.
§Parameters
name
: The name of the histogram metric to record.value
: The value to add to the histogram, typically representing time or size.