pub struct ErrorCluster {
pub id: u64,
pub centroid: ErrorPattern,
pub members: Vec<u64>,
pub strategies: Vec<RecoveryStrategy>,
pub total_occurrences: u32,
pub total_recoveries: u32,
}Expand description
A cluster of similar errors
Fields§
§id: u64Cluster identifier
centroid: ErrorPatternRepresentative pattern (centroid)
members: Vec<u64>Member patterns
strategies: Vec<RecoveryStrategy>Aggregate recovery strategies
total_occurrences: u32Total occurrences in cluster
total_recoveries: u32Total recoveries in cluster
Implementations§
Source§impl ErrorCluster
impl ErrorCluster
Sourcepub fn new(id: u64, pattern: ErrorPattern) -> Self
pub fn new(id: u64, pattern: ErrorPattern) -> Self
Create a new cluster from a pattern
Sourcepub fn success_rate(&self) -> f32
pub fn success_rate(&self) -> f32
Get cluster success rate
Sourcepub fn add_member(&mut self, pattern: &ErrorPattern)
pub fn add_member(&mut self, pattern: &ErrorPattern)
Add a member pattern
Sourcepub fn add_strategy(&mut self, strategy: RecoveryStrategy)
pub fn add_strategy(&mut self, strategy: RecoveryStrategy)
Add a recovery strategy
Sourcepub fn best_strategies(&self, limit: usize) -> Vec<&RecoveryStrategy>
pub fn best_strategies(&self, limit: usize) -> Vec<&RecoveryStrategy>
Get best strategies sorted by success rate
Trait Implementations§
Source§impl Clone for ErrorCluster
impl Clone for ErrorCluster
Source§fn clone(&self) -> ErrorCluster
fn clone(&self) -> ErrorCluster
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 ErrorCluster
impl Debug for ErrorCluster
Source§impl<'de> Deserialize<'de> for ErrorCluster
impl<'de> Deserialize<'de> for ErrorCluster
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorCluster
impl RefUnwindSafe for ErrorCluster
impl Send for ErrorCluster
impl Sync for ErrorCluster
impl Unpin for ErrorCluster
impl UnsafeUnpin for ErrorCluster
impl UnwindSafe for ErrorCluster
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more