pub struct AlertSystem { /* private fields */ }Expand description
Alert system for regression notifications
Manages alert generation, notification delivery, cooldown periods, and integration with external services like email, Slack, and GitHub.
Implementations§
Source§impl AlertSystem
impl AlertSystem
Sourcepub fn with_config(config: AlertConfig) -> Self
pub fn with_config(config: AlertConfig) -> Self
Create a new alert system with custom configuration
Sourcepub fn config(&self) -> &AlertConfig
pub fn config(&self) -> &AlertConfig
Get the current alert configuration
Sourcepub fn update_config(&mut self, config: AlertConfig)
pub fn update_config(&mut self, config: AlertConfig)
Update the alert configuration
Sourcepub fn alert_history(&self) -> &VecDeque<Alert>
pub fn alert_history(&self) -> &VecDeque<Alert>
Get alert history
Sourcepub fn send_alert<A: Float>(
&mut self,
regression: &RegressionResult<A>,
) -> Result<()>
pub fn send_alert<A: Float>( &mut self, regression: &RegressionResult<A>, ) -> Result<()>
Send an alert for a regression
Sourcepub fn get_active_alerts(&self) -> Vec<&Alert>
pub fn get_active_alerts(&self) -> Vec<&Alert>
Get active alerts (not acknowledged or resolved)
Sourcepub fn get_recent_alerts(&self, duration: Duration) -> Vec<&Alert>
pub fn get_recent_alerts(&self, duration: Duration) -> Vec<&Alert>
Get recent alerts within the specified duration
Sourcepub fn acknowledge_alert(&mut self, alert_id: &str) -> Result<()>
pub fn acknowledge_alert(&mut self, alert_id: &str) -> Result<()>
Acknowledge an alert by ID
Sourcepub fn resolve_alert(&mut self, alert_id: &str) -> Result<()>
pub fn resolve_alert(&mut self, alert_id: &str) -> Result<()>
Resolve an alert by ID
Sourcepub fn cleanup_old_alerts(&mut self, max_age: Duration) -> usize
pub fn cleanup_old_alerts(&mut self, max_age: Duration) -> usize
Clear old alerts from history
Sourcepub fn get_alert_statistics(&self) -> AlertStatistics
pub fn get_alert_statistics(&self) -> AlertStatistics
Get statistics about alerts
Trait Implementations§
Source§impl Debug for AlertSystem
impl Debug for AlertSystem
Auto Trait Implementations§
impl Freeze for AlertSystem
impl RefUnwindSafe for AlertSystem
impl Send for AlertSystem
impl Sync for AlertSystem
impl Unpin for AlertSystem
impl UnsafeUnpin for AlertSystem
impl UnwindSafe for AlertSystem
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 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.