pub struct LogAnalyzer { /* private fields */ }Expand description
Log analyzer with pattern detection and alerting
Implementations§
Source§impl LogAnalyzer
impl LogAnalyzer
Sourcepub fn add_pattern(&mut self, pattern: LogPattern) -> RusTorchResult<()>
pub fn add_pattern(&mut self, pattern: LogPattern) -> RusTorchResult<()>
Add log pattern
Sourcepub fn add_alert_rule(&mut self, rule: AlertRule)
pub fn add_alert_rule(&mut self, rule: AlertRule)
Add alert rule
Sourcepub fn analyze_log_entry(
&mut self,
level: LogLevel,
message: &str,
metadata: &HashMap<String, String>,
) -> RusTorchResult<Vec<PatternMatch>>
pub fn analyze_log_entry( &mut self, level: LogLevel, message: &str, metadata: &HashMap<String, String>, ) -> RusTorchResult<Vec<PatternMatch>>
Analyze log entry for patterns
Sourcepub fn get_analysis_summary(&self) -> AnalysisSummary
pub fn get_analysis_summary(&self) -> AnalysisSummary
Get analysis summary
Sourcepub fn get_recent_matches(&self, n: usize) -> Vec<&PatternMatch>
pub fn get_recent_matches(&self, n: usize) -> Vec<&PatternMatch>
Get recent pattern matches
Sourcepub fn get_pattern_matches(&self, pattern_name: &str) -> Vec<&PatternMatch>
pub fn get_pattern_matches(&self, pattern_name: &str) -> Vec<&PatternMatch>
Get matches for specific pattern
Sourcepub fn get_triggered_alerts(&self) -> &[AlertNotification]
pub fn get_triggered_alerts(&self) -> &[AlertNotification]
Get all triggered alerts
Sourcepub fn get_total_alerts(&self) -> usize
pub fn get_total_alerts(&self) -> usize
Get total alerts count
Sourcepub fn enable_pattern(
&mut self,
pattern_name: &str,
enabled: bool,
) -> RusTorchResult<()>
pub fn enable_pattern( &mut self, pattern_name: &str, enabled: bool, ) -> RusTorchResult<()>
Enable/disable pattern
Sourcepub fn enable_alert_rule(
&mut self,
rule_name: &str,
enabled: bool,
) -> RusTorchResult<()>
pub fn enable_alert_rule( &mut self, rule_name: &str, enabled: bool, ) -> RusTorchResult<()>
Enable/disable alert rule
Sourcepub fn generate_analysis_report(&self) -> String
pub fn generate_analysis_report(&self) -> String
Generate analysis report
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable/disable analyzer
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if analyzer is enabled
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogAnalyzer
impl RefUnwindSafe for LogAnalyzer
impl Send for LogAnalyzer
impl Sync for LogAnalyzer
impl Unpin for LogAnalyzer
impl UnwindSafe for LogAnalyzer
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> 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