Skip to main content

CycleObservation

Struct CycleObservation 

Source
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: u64

Monotonic cycle counter, advances on every dispatch attempt including faulted scans (REQ_0107).

§task_id: TaskId

Identifier of the task this observation belongs to.

§task_index: u32

Stable 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: bool

true 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: u64

Declared (nominal) scan period in nanoseconds. Always known.

§pre_ns: u64

Telemetry-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: u32

Nominal 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

Source§

fn clone(&self) -> CycleObservation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CycleObservation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.