2026-08-15 08:17:48 +00:00
|
|
|
|
//! Telemetry-owned self-health record.
|
2026-06-23 15:42:28 +00:00
|
|
|
|
|
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
|
|
|
|
use crate::record::Record;
|
|
|
|
|
|
|
2026-08-15 08:17:48 +00:00
|
|
|
|
/// Telemetry self-health — the mux's own integrity counters.
|
|
|
|
|
|
pub const TELEMETRY_HEALTH: &str = "telemetry.health";
|
2026-06-23 15:42:28 +00:00
|
|
|
|
|
|
|
|
|
|
/// `assigned` is the gap-free high-water mark (every position handed out);
|
|
|
|
|
|
/// `dropped` is the frames lost to mux overflow.
|
|
|
|
|
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
2026-08-15 08:17:48 +00:00
|
|
|
|
pub struct TelemetryHealth {
|
2026-06-23 15:42:28 +00:00
|
|
|
|
#[serde(default)]
|
|
|
|
|
|
pub assigned: u64,
|
|
|
|
|
|
#[serde(default)]
|
|
|
|
|
|
pub dropped: u64,
|
|
|
|
|
|
/// `dropped / assigned × 1_000_000`; `0` when nothing has been assigned yet.
|
|
|
|
|
|
#[serde(default)]
|
|
|
|
|
|
pub loss_rate_ppm: u32,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-08-15 08:17:48 +00:00
|
|
|
|
impl Record for TelemetryHealth {
|
|
|
|
|
|
const CHANNEL: &'static str = TELEMETRY_HEALTH;
|
2026-06-23 15:42:28 +00:00
|
|
|
|
}
|