crate::endpoints! {
snapshot: Query<SnapshotRequest, Snapshot>;
follow: Stream<Follow, Out>;
}
use crate::runtime::api::telemetry::{Cursor, Step, Topic};
#[derive(
phoxal_macros::DescribeWire, Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize,
)]
pub struct SnapshotRequest {
pub participant_id: Option<String>,
pub limit: u32,
pub before_sequence: Option<u64>,
}
#[derive(
phoxal_macros::DescribeWire, Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize,
)]
pub struct Record {
pub sequence: u64,
pub participant_id: String,
pub truncated: u32,
pub window_ns: u64,
pub step: Option<Step>,
pub topics: Vec<Topic>,
pub overflow: Option<Topic>,
}
#[derive(
phoxal_macros::DescribeWire, Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize,
)]
pub struct Snapshot {
pub cursor: Cursor,
pub records: Vec<Record>,
pub capacity_evictions: u64,
pub next_before_sequence: Option<u64>,
}
#[derive(
phoxal_macros::DescribeWire, Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize,
)]
pub struct Follow {
pub cursor: Cursor,
pub record: Record,
}