pub struct Metrics;
Expand description
A mock metrics implementation for testing.
This struct provides no-op implementations of all metrics methods to facilitate testing without requiring a real metrics backend.
Implementations§
Source§impl Metrics
impl Metrics
Sourcepub fn record_action_execution(&self, _executor_label: &str, _duration: f64)
pub fn record_action_execution(&self, _executor_label: &str, _duration: f64)
Records the duration of an action execution.
§Arguments
executor_label
- The label identifying the executorduration
- The duration of the action execution in seconds
Sourcepub fn inc_actions_executed(&self, _executor_label: &str)
pub fn inc_actions_executed(&self, _executor_label: &str)
Increments the count of executed actions.
§Arguments
executor_label
- The label identifying the executor
Sourcepub fn record_error(&self, _component: &str, _error_type: &str)
pub fn record_error(&self, _component: &str, _error_type: &str)
Records an error occurrence.
§Arguments
component
- The component where the error occurrederror_type
- The type of error that occurred
Sourcepub fn record_event_processing(&self, _strategy_label: &str, _duration: f64)
pub fn record_event_processing(&self, _strategy_label: &str, _duration: f64)
Records the duration of event processing.
§Arguments
strategy_label
- The label identifying the strategyduration
- The duration of event processing in seconds
Sourcepub fn update_event_queue_size(&self, _collector_label: &str, _size: i64)
pub fn update_event_queue_size(&self, _collector_label: &str, _size: i64)
Updates the current size of the event queue.
§Arguments
collector_label
- The label identifying the collectorsize
- The current size of the queue
Sourcepub fn inc_events_processed(&self, _collector_label: &str)
pub fn inc_events_processed(&self, _collector_label: &str)
Increments the count of processed events.
§Arguments
collector_label
- The label identifying the collector
Sourcepub fn update_action_queue_size(&self, _strategy_label: &str, _size: i64)
pub fn update_action_queue_size(&self, _strategy_label: &str, _size: i64)
Updates the current size of the action queue.
§Arguments
strategy_label
- The label identifying the strategysize
- The current size of the queue
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metrics
impl RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnwindSafe for Metrics
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