pub struct ErrorMetrics {
pub total_errors: u64,
pub errors_by_type: HashMap<String, u64>,
pub errors_by_organism: HashMap<String, u64>,
pub recovery_attempts: u64,
pub successful_recoveries: u64,
pub last_error_time: u64,
}
Expand description
Error metrics for monitoring
Fields§
§total_errors: u64
§errors_by_type: HashMap<String, u64>
§errors_by_organism: HashMap<String, u64>
§recovery_attempts: u64
§successful_recoveries: u64
§last_error_time: u64
Implementations§
Source§impl ErrorMetrics
impl ErrorMetrics
pub fn new() -> Self
pub fn record_error(&mut self, error: &GenesisError, organism_id: Option<&str>)
pub fn record_recovery_attempt(&mut self, successful: bool)
pub fn get_error_rate(&self) -> f64
pub fn get_recovery_rate(&self) -> f64
Trait Implementations§
Source§impl Clone for ErrorMetrics
impl Clone for ErrorMetrics
Source§fn clone(&self) -> ErrorMetrics
fn clone(&self) -> ErrorMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ErrorMetrics
impl Debug for ErrorMetrics
Auto Trait Implementations§
impl Freeze for ErrorMetrics
impl RefUnwindSafe for ErrorMetrics
impl Send for ErrorMetrics
impl Sync for ErrorMetrics
impl Unpin for ErrorMetrics
impl UnwindSafe for ErrorMetrics
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