pub struct DashboardDataProvider { /* private fields */ }Expand description
Aggregates metrics from workflow engine state into DashboardSnapshots.
The provider holds an internal event log and counters that are updated
as workflows and tasks progress. Call DashboardDataProvider::snapshot
to obtain a consistent read of all metrics at a given timestamp.
Implementations§
Source§impl DashboardDataProvider
impl DashboardDataProvider
Sourcepub fn on_workflow_started(
&mut self,
workflow_id: impl Into<String>,
name: impl Into<String>,
total_tasks: usize,
started_at_secs: u64,
)
pub fn on_workflow_started( &mut self, workflow_id: impl Into<String>, name: impl Into<String>, total_tasks: usize, started_at_secs: u64, )
Register a workflow starting.
Sourcepub fn on_workflow_completed(
&mut self,
workflow_id: &str,
success: bool,
now_secs: u64,
)
pub fn on_workflow_completed( &mut self, workflow_id: &str, success: bool, now_secs: u64, )
Record a workflow completing (successfully or otherwise).
Sourcepub fn on_task_completed(
&mut self,
workflow_id: &str,
task_name: &str,
success: bool,
duration_secs: f64,
now_secs: u64,
)
pub fn on_task_completed( &mut self, workflow_id: &str, task_name: &str, success: bool, duration_secs: f64, now_secs: u64, )
Record a task completing.
Sourcepub fn on_task_failed(
&mut self,
task_name: &str,
error: impl Into<String>,
retry_count: u32,
)
pub fn on_task_failed( &mut self, task_name: &str, error: impl Into<String>, retry_count: u32, )
Record a task failure with an error message.
Sourcepub fn update_queue_depth(&mut self, snapshot: QueueDepthSnapshot)
pub fn update_queue_depth(&mut self, snapshot: QueueDepthSnapshot)
Update the queue depth snapshot.
Sourcepub fn set_custom_metric(&mut self, key: impl Into<String>, value: Value)
pub fn set_custom_metric(&mut self, key: impl Into<String>, value: Value)
Set a custom metric value.
Sourcepub fn snapshot(&self, now_secs: u64) -> DashboardSnapshot
pub fn snapshot(&self, now_secs: u64) -> DashboardSnapshot
Build a DashboardSnapshot at the given timestamp.
Trait Implementations§
Source§impl Debug for DashboardDataProvider
impl Debug for DashboardDataProvider
Source§impl Default for DashboardDataProvider
impl Default for DashboardDataProvider
Source§fn default() -> DashboardDataProvider
fn default() -> DashboardDataProvider
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DashboardDataProvider
impl RefUnwindSafe for DashboardDataProvider
impl Send for DashboardDataProvider
impl Sync for DashboardDataProvider
impl Unpin for DashboardDataProvider
impl UnsafeUnpin for DashboardDataProvider
impl UnwindSafe for DashboardDataProvider
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