pub struct PatternAnalyzer { /* private fields */ }Expand description
パターン分析器
バックアップ失敗のパターンを分析します。
§使用例
use backup_suite::smart::anomaly::PatternAnalyzer;
use backup_suite::BackupHistory;
let analyzer = PatternAnalyzer::new();
let histories = BackupHistory::load_all().unwrap();
let failure_rate = analyzer.calculate_failure_rate(&histories).unwrap();
println!("失敗率: {:.1}%", failure_rate.as_percentage());
let patterns = analyzer.detect_failure_patterns(&histories).unwrap();
for pattern in patterns {
println!("頻発エラー: {} ({}回)", pattern.error_message(), pattern.count());
}Implementations§
Source§impl PatternAnalyzer
impl PatternAnalyzer
Sourcepub fn calculate_failure_rate(
&self,
histories: &[BackupHistory],
) -> SmartResult<FailureRate>
pub fn calculate_failure_rate( &self, histories: &[BackupHistory], ) -> SmartResult<FailureRate>
Sourcepub fn detect_failure_patterns(
&self,
histories: &[BackupHistory],
) -> SmartResult<Vec<FailurePattern>>
pub fn detect_failure_patterns( &self, histories: &[BackupHistory], ) -> SmartResult<Vec<FailurePattern>>
Sourcepub fn calculate_failure_rate_by_category(
&self,
histories: &[BackupHistory],
) -> SmartResult<HashMap<String, FailureRate>>
pub fn calculate_failure_rate_by_category( &self, histories: &[BackupHistory], ) -> SmartResult<HashMap<String, FailureRate>>
Sourcepub fn analyze_failure_by_hour(
&self,
histories: &[BackupHistory],
) -> SmartResult<HashMap<u32, FailureRate>>
pub fn analyze_failure_by_hour( &self, histories: &[BackupHistory], ) -> SmartResult<HashMap<u32, FailureRate>>
Trait Implementations§
Source§impl Clone for PatternAnalyzer
impl Clone for PatternAnalyzer
Source§fn clone(&self) -> PatternAnalyzer
fn clone(&self) -> PatternAnalyzer
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 PatternAnalyzer
impl Debug for PatternAnalyzer
Auto Trait Implementations§
impl Freeze for PatternAnalyzer
impl RefUnwindSafe for PatternAnalyzer
impl Send for PatternAnalyzer
impl Sync for PatternAnalyzer
impl Unpin for PatternAnalyzer
impl UnwindSafe for PatternAnalyzer
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.