Skip to main content

DashboardSource

Trait DashboardSource 

Source
pub trait DashboardSource {
    // Required methods
    fn status(&self) -> RunStatus;
    fn recent_metrics(&self, limit: usize) -> HashMap<String, MetricSnapshot>;
    fn subscribe(&self, callback: SubscriptionCallback);
    fn resource_usage(&self) -> ResourceSnapshot;
}
Expand description

Dashboard data source trait.

Implement this trait to provide data for real-time dashboards.

Required Methods§

Source

fn status(&self) -> RunStatus

Get the current run status.

Source

fn recent_metrics(&self, limit: usize) -> HashMap<String, MetricSnapshot>

Get recent metrics, limited to limit points per metric.

Source

fn subscribe(&self, callback: SubscriptionCallback)

Subscribe to metric updates.

Returns a receiver that will receive metric snapshots as they arrive. The callback is called with the metric key and latest value.

Source

fn resource_usage(&self) -> ResourceSnapshot

Get current resource usage.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§