add reminder_stats field to stats Snapshot
Add Optional<ReminderStats> field to the per-agent stats page response, placeholder for future ReminderRollup RPC integration to fetch reminder activity metrics from the broker.
This commit is contained in:
parent
8fe0725e1d
commit
f2015954d9
1 changed files with 9 additions and 0 deletions
|
|
@ -14,6 +14,8 @@ use anyhow::{Context, Result};
|
||||||
use rusqlite::{Connection, OpenFlags};
|
use rusqlite::{Connection, OpenFlags};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use hive_sh4re::ReminderStats;
|
||||||
|
|
||||||
/// Window param accepted by `/api/stats?window=`. Each maps to a
|
/// Window param accepted by `/api/stats?window=`. Each maps to a
|
||||||
/// total span + the bucket width used to roll up trend series.
|
/// total span + the bucket width used to roll up trend series.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
|
@ -81,6 +83,11 @@ pub struct Snapshot {
|
||||||
/// as the per-bucket fields but aggregated over the whole window
|
/// as the per-bucket fields but aggregated over the whole window
|
||||||
/// for the headline summary chips.
|
/// for the headline summary chips.
|
||||||
pub duration_summary: DurationSummary,
|
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<ReminderStats>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
|
|
@ -152,6 +159,7 @@ fn empty_snapshot(window: Window) -> Snapshot {
|
||||||
result_mix: Vec::new(),
|
result_mix: Vec::new(),
|
||||||
models: Vec::new(),
|
models: Vec::new(),
|
||||||
duration_summary: DurationSummary::default(),
|
duration_summary: DurationSummary::default(),
|
||||||
|
reminder_stats: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -250,6 +258,7 @@ fn snapshot(path: &Path, window: Window) -> Result<Snapshot> {
|
||||||
result_mix: top_n(result_totals, 20),
|
result_mix: top_n(result_totals, 20),
|
||||||
models,
|
models,
|
||||||
duration_summary,
|
duration_summary,
|
||||||
|
reminder_stats: None, // TODO: fetch via ReminderRollup RPC
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue