pub struct CycleObservation {
pub cycle_index: u64,
pub task_id: TaskId,
pub task_index: u32,
pub faulted: bool,
pub period_ns: u64,
pub pre_ns: u64,
pub actual_period_ns: Option<u64>,
pub jitter_ns: Option<u64>,
pub lateness_ns: Option<i64>,
pub skipped_slots: u32,
pub took_ns: Option<u64>,
}Expand description
A single per-task observation pushed by the executor each cycle.
One value is emitted per dispatched task per cycle and handed to the
observer (or buffered for aggregation). Because TaskId is Arc<str>
under the hood, CycleObservation is Clone but not Copy.
Absent vs. zero (REQ_0103). Every measured quantity is an
Option: None means “not measured this cycle”, which is not the
same as a measured 0. A faulted scan (see faulted
and REQ_0107) advances cycle_index but enters no task body, so
took_ns/jitter_ns/lateness_ns are all None; actual_period_ns
is also None on the very first cycle. This mirrors the connector’s
observation contract (REQ_0267), where a faulted wire round reports
wire_round_ns: None — so a consumer joining the two push streams on
cycle_index sees a consistent “absent on fault” signal from both
layers instead of an ambiguous 0.
Fields§
§cycle_index: u64Monotonic cycle counter, advances on every dispatch attempt including
faulted scans (REQ_0107).
task_id: TaskIdIdentifier of the task this observation belongs to.
task_index: u32Stable zero-based registration index of the task, assigned at
Executor::add time and constant for the executor’s lifetime
(REQ_0103). The flat u32 join/identity key for telemetry export
(REQ_0111’s task_id column) — frees consumers from hashing the
Arc<str> task_id on the hot path.
faulted: booltrue when this scan was fault-routed / skipped: the task body was
not entered, so every measured field below is None (REQ_0107).
The cross-layer twin of the connector’s CycleOutcome::Fault
(REQ_0267).
period_ns: u64Declared (nominal) scan period in nanoseconds. Always known.
pre_ns: u64Telemetry-clock nanosecond instant of task-logic start — the
canonical reference point (pre_execute), the same instant the
period/jitter/lateness folds are sampled against (REQ_0103,
REQ_0101). The single time source for an exported sample’s time
axis; never a second clock read. Always populated.
actual_period_ns: Option<u64>Measured period since the previous dispatch of this task in
nanoseconds. None on the first cycle (no previous timestamp).
jitter_ns: Option<u64>Absolute jitter: |actual_period_ns − period_ns|. None when not
measurable (first cycle) or on a faulted scan.
lateness_ns: Option<i64>Signed deadline lateness relative to the nominal dispatch grid in
nanoseconds; positive means late (REQ_0106). None on a faulted
scan or an event-driven task.
skipped_slots: u32Nominal grid slots the dispatcher passed over unserved between the
slot served by this task’s previous dispatch and the slot served by
this one (the skip-realign of REQ_0268), per REQ_0840. Always
present: 0 in steady state, always 0 in Legacy dispatch mode
(which never skips slots) and on a task’s first recorded cycle. The
lateness grid of REQ_0106 advances by exactly 1 + skipped_slots.
took_ns: Option<u64>Wall-clock execution duration of the task in nanoseconds. None on
a faulted scan (the body was not entered) or when no sample was
recorded this cycle (e.g. a fault handler ran in the item’s place).
Trait Implementations§
Source§impl Clone for CycleObservation
impl Clone for CycleObservation
Source§fn clone(&self) -> CycleObservation
fn clone(&self) -> CycleObservation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more