Skip to main content

zenkey_fleet/
tape.rs

1//! **Layer 4 — the tape.** Traffic as a *thing*: captured, read back,
2//! manufactured, measured.
3//!
4//! One rule places a module here: *it turns a stream of samples into a
5//! recording, or a recording into a stream of samples*. The bus is where
6//! traffic happens; this is where it is put in a box.
7//!
8//! * [`record`] — `.zrec` capture and replay. Normative for the format
9//!   (RFC 09 §5.2 documents the etiquette).
10//! * [`ingest`] — the row dialect a capture is made of, read back: the same
11//!   shape `echo --format ndjson` emits, so a pipe and a file are one
12//!   format with one parser.
13//! * [`generate`] — traffic that never happened, on purpose: mock producers
14//!   and fault patterns, every sample carrying the synthetic marker so that
15//!   nothing downstream can mistake a rehearsal for a fleet.
16//! * [`snapshot`] — `.zsnap`, a fan-in GET kept on disk (RFC 13 §4.4): the
17//!   sibling of a capture, collected *over* a span and saying so.
18//! * [`trigger`] — the retained window as a capture: armed on a condition,
19//!   written only when it fires, with the state preamble that makes a
20//!   pre-roll of `state` deltas readable (RFC 13 §4.1 version 2).
21//! * [`synth`] — payload bodies for the above, synthesized from a schema.
22//! * [`bench`](mod@bench) — traffic manufactured to be timed, and the timing.
23//!
24//! The layer's own honesty rule is the one the file format carries: a
25//! capture taken while behind is a partial view, and it says so **at the
26//! position of the loss** (RFC 09 §5.1 O6, applied to a file). A replay of a
27//! lossy capture is not a replay of the fleet, and neither the reader nor
28//! the report is allowed to smooth that over.
29
30pub mod bench;
31pub mod ingest;
32pub mod record;
33pub mod snapshot;
34
35#[cfg(feature = "decode")]
36pub mod generate;
37#[cfg(feature = "decode")]
38pub mod synth;
39#[cfg(feature = "decode")]
40pub mod trigger;