pub struct DashboardManager { /* private fields */ }Expand description
Dashboard manager
Implementations§
Source§impl DashboardManager
impl DashboardManager
Sourcepub fn new(
analytics: Arc<ChaosAnalytics>,
alert_manager: Arc<AlertManager>,
) -> Self
pub fn new( analytics: Arc<ChaosAnalytics>, alert_manager: Arc<AlertManager>, ) -> Self
Create a new dashboard manager
Sourcepub fn subscribe(&self) -> Receiver<DashboardUpdate>
pub fn subscribe(&self) -> Receiver<DashboardUpdate>
Subscribe to dashboard updates
Sourcepub fn send_update(&self, update: DashboardUpdate)
pub fn send_update(&self, update: DashboardUpdate)
Send a dashboard update
Sourcepub fn broadcast_metrics(&self, bucket: MetricsBucket)
pub fn broadcast_metrics(&self, bucket: MetricsBucket)
Broadcast metrics update
Sourcepub fn broadcast_alert(&self, alert: Alert)
pub fn broadcast_alert(&self, alert: Alert)
Broadcast alert
Sourcepub fn broadcast_alert_resolved(&self, alert_id: String)
pub fn broadcast_alert_resolved(&self, alert_id: String)
Broadcast alert resolution
Sourcepub fn broadcast_scenario_status(
&self,
scenario_name: String,
status: String,
progress: Option<f64>,
)
pub fn broadcast_scenario_status( &self, scenario_name: String, status: String, progress: Option<f64>, )
Broadcast scenario status
Sourcepub fn broadcast_impact(&self, impact: ChaosImpact)
pub fn broadcast_impact(&self, impact: ChaosImpact)
Broadcast impact update
Sourcepub fn get_stats(&self) -> DashboardStats
pub fn get_stats(&self) -> DashboardStats
Get current statistics
Sourcepub fn get_metrics_range(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
bucket_size: TimeBucket,
) -> Vec<MetricsBucket>
pub fn get_metrics_range( &self, start: DateTime<Utc>, end: DateTime<Utc>, bucket_size: TimeBucket, ) -> Vec<MetricsBucket>
Get metrics for time range
Sourcepub fn get_impact_analysis(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> ChaosImpact
pub fn get_impact_analysis( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> ChaosImpact
Get impact analysis
Sourcepub fn get_active_alerts(&self) -> Vec<Alert>
pub fn get_active_alerts(&self) -> Vec<Alert>
Get active alerts
Sourcepub async fn start_update_loop(&self, interval_seconds: u64)
pub async fn start_update_loop(&self, interval_seconds: u64)
Start background update loop
Auto Trait Implementations§
impl Freeze for DashboardManager
impl !RefUnwindSafe for DashboardManager
impl Send for DashboardManager
impl Sync for DashboardManager
impl Unpin for DashboardManager
impl !UnwindSafe for DashboardManager
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request