pub struct NoopMetrics;
Expand description
No-op metrics implementation suitable as a default.
Implementations§
Source§impl NoopMetrics
impl NoopMetrics
Trait Implementations§
Source§impl Default for NoopMetrics
impl Default for NoopMetrics
Source§impl Metrics for NoopMetrics
impl Metrics for NoopMetrics
Source§fn incr_counter<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
_value: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn incr_counter<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
_value: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Increment a named counter by
value
.Source§fn record_gauge<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
_value: f64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_gauge<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
_value: f64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Record a gauge metric.
Source§fn start_timer<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn Timer + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start_timer<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn Timer + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start a timer for a named operation. Returns a boxed Timer which should be stopped
when the operation completes. Implementations may return None if timers aren’t supported.
Source§fn record_histogram<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 str,
_value: f64,
) -> Pin<Box<dyn Future<Output = ()> + 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 = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Record a histogram value for a named metric.
Record a histogram value with tags/labels.
Increment a counter with tags/labels.
Record a gauge with tags/labels.
Source§fn record_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_name: &'life1 str,
_error_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn record_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_name: &'life1 str,
_error_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Record an error occurrence.
Auto Trait Implementations§
impl Freeze for NoopMetrics
impl RefUnwindSafe for NoopMetrics
impl Send for NoopMetrics
impl Sync for NoopMetrics
impl Unpin for NoopMetrics
impl UnwindSafe for NoopMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> MetricsExt for Twhere
T: Metrics,
impl<T> MetricsExt for Twhere
T: Metrics,
Source§async fn record_request(
&self,
name: &str,
timer: Option<Box<dyn Timer + Send>>,
success: bool,
)
async fn record_request( &self, name: &str, timer: Option<Box<dyn Timer + Send>>, success: bool, )
Record a request with timing and success/failure
Record a request with timing, success/failure, and tags
Source§async fn record_error_with_context(
&self,
name: &str,
error_type: &str,
context: &str,
)
async fn record_error_with_context( &self, name: &str, error_type: &str, context: &str, )
Record an error with context