pub struct ErrorMonitor { /* private fields */ }Implementations§
Source§impl ErrorMonitor
impl ErrorMonitor
pub fn new() -> Self
Sourcepub fn record_error(&self, error: &OfficeError)
pub fn record_error(&self, error: &OfficeError)
记录错误
Sourcepub fn get_stats(&self) -> Vec<ErrorStats>
pub fn get_stats(&self) -> Vec<ErrorStats>
获取错误统计
Sourcepub async fn record_error_async(&self, error: &OfficeError)
pub async fn record_error_async(&self, error: &OfficeError)
异步记录错误
Sourcepub async fn get_stats_async(&self) -> Vec<ErrorStats>
pub async fn get_stats_async(&self) -> Vec<ErrorStats>
异步获取统计信息
Sourcepub fn detect_error_patterns(&self) -> Vec<ErrorPattern>
pub fn detect_error_patterns(&self) -> Vec<ErrorPattern>
检测错误模式
Sourcepub fn set_error_threshold(&self, category: ErrorCategory, threshold: u64)
pub fn set_error_threshold(&self, category: ErrorCategory, threshold: u64)
设置错误阈值告警
Sourcepub fn total_errors(&self) -> u64
pub fn total_errors(&self) -> u64
获取总错误数
Sourcepub fn most_common_errors(&self, limit: usize) -> Vec<ErrorStats>
pub fn most_common_errors(&self, limit: usize) -> Vec<ErrorStats>
获取最常见的错误
Sourcepub fn collect_metrics(&self) -> ErrorMetrics
pub fn collect_metrics(&self) -> ErrorMetrics
添加错误指标收集
Sourcepub fn analyze_trends(&self, duration: Duration) -> TrendAnalysis
pub fn analyze_trends(&self, duration: Duration) -> TrendAnalysis
提供错误趋势分析
Sourcepub fn generate_report(&self, error: &OfficeError) -> ErrorReport
pub fn generate_report(&self, error: &OfficeError) -> ErrorReport
生成详细错误报告
Sourcepub fn export_stats_report(&self, format: ReportFormat) -> Vec<u8> ⓘ
pub fn export_stats_report(&self, format: ReportFormat) -> Vec<u8> ⓘ
导出错误统计报告
Sourcepub fn clear_stats(&self)
pub fn clear_stats(&self)
清除统计信息
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ErrorMonitor
impl RefUnwindSafe for ErrorMonitor
impl Send for ErrorMonitor
impl Sync for ErrorMonitor
impl Unpin for ErrorMonitor
impl UnsafeUnpin for ErrorMonitor
impl UnwindSafe for ErrorMonitor
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