diff --git a/hive-ag3nt/src/stats.rs b/hive-ag3nt/src/stats.rs index 55e7c80..bf95b45 100644 --- a/hive-ag3nt/src/stats.rs +++ b/hive-ag3nt/src/stats.rs @@ -14,6 +14,8 @@ use anyhow::{Context, Result}; use rusqlite::{Connection, OpenFlags}; use serde::Serialize; +use hive_sh4re::ReminderStats; + /// Window param accepted by `/api/stats?window=`. Each maps to a /// total span + the bucket width used to roll up trend series. #[derive(Debug, Clone, Copy)] @@ -81,6 +83,11 @@ pub struct Snapshot { /// as the per-bucket fields but aggregated over the whole window /// for the headline summary chips. pub duration_summary: DurationSummary, + /// Reminder activity stats: counts of scheduled, delivered, and + /// pending reminders over the window (fetched from the broker RPC). + /// None if the RPC call failed or hasn't been integrated yet. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reminder_stats: Option, } #[derive(Debug, Serialize)] @@ -152,6 +159,7 @@ fn empty_snapshot(window: Window) -> Snapshot { result_mix: Vec::new(), models: Vec::new(), duration_summary: DurationSummary::default(), + reminder_stats: None, } } @@ -250,6 +258,7 @@ fn snapshot(path: &Path, window: Window) -> Result { result_mix: top_n(result_totals, 20), models, duration_summary, + reminder_stats: None, // TODO: fetch via ReminderRollup RPC }) }