pub struct ErrorMonitor { /* private fields */ }Expand description
错误监控器
Implementations§
Source§impl ErrorMonitor
impl ErrorMonitor
Sourcepub fn new(config: MonitorConfig) -> Self
pub fn new(config: MonitorConfig) -> Self
创建新的错误监控器
Sourcepub fn record_error(&self, error: LarkAPIError)
pub fn record_error(&self, error: LarkAPIError)
记录错误事件
Sourcepub fn record_error_with_context(
&self,
error: LarkAPIError,
context: HashMap<String, String>,
)
pub fn record_error_with_context( &self, error: LarkAPIError, context: HashMap<String, String>, )
记录带上下文的错误事件
Sourcepub fn record_event(&self, event: ErrorEvent)
pub fn record_event(&self, event: ErrorEvent)
记录错误事件
Sourcepub fn get_statistics(&self) -> ErrorStatistics
pub fn get_statistics(&self) -> ErrorStatistics
获取统计数据
Sourcepub fn get_recent_events(&self, limit: usize) -> Vec<ErrorEvent>
pub fn get_recent_events(&self, limit: usize) -> Vec<ErrorEvent>
获取最近的错误事件
Sourcepub fn cleanup_old_events(&self)
pub fn cleanup_old_events(&self)
清理旧事件
Sourcepub fn reset_statistics(&self)
pub fn reset_statistics(&self)
重置统计数据
Sourcepub fn generate_report(&self) -> ErrorReport
pub fn generate_report(&self) -> ErrorReport
生成错误报告
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 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