pub struct Telemetry {
pub device_read_errors: Gauge,
pub energy_mj: Counter,
pub energy_counter_raw: Gauge,
pub energy_resets: Counter,
pub energy_wraps: Counter,
pub tokens: Counter,
pub joules_per_token_live: GaugeF64,
pub kernel: KernelInstruments,
pub sched: SchedInstruments,
pub spec: SpecMatrix,
pub spec_confidence: ConfidenceOutcomes,
pub requests: RequestInstruments,
/* private fields */
}Fields§
§device_read_errors: Gauge§energy_mj: Counter§energy_counter_raw: Gauge§energy_resets: Counter§energy_wraps: Counter§tokens: Counter§joules_per_token_live: GaugeF64§kernel: KernelInstruments§sched: SchedInstruments§spec: SpecMatrix§spec_confidence: ConfidenceOutcomes§requests: RequestInstrumentsImplementations§
Source§impl Telemetry
impl Telemetry
Sourcepub const fn new(clock: &'static dyn Clock) -> Self
pub const fn new(clock: &'static dyn Clock) -> Self
2026-09-26: A set at level Off over clock. Allocates nothing.
Sourcepub fn configure(&self, cfg: &TelemetryConfig)
pub fn configure(&self, cfg: &TelemetryConfig)
2026-09-26: Apply a validated configuration and disarm kernel spans.
The energy ring is allocated here, on the first call at Basic or
above, and never again.
pub fn level(&self) -> Level
Sourcepub fn set_phase_names(&self, names: &'static [&'static str])
pub fn set_phase_names(&self, names: &'static [&'static str])
2026-09-26: Name the loop phases phase indexes, keeping at most
MAX_PHASES. The first call wins.
pub fn phase_names(&self) -> &'static [&'static str]
Sourcepub fn phase(&self, idx: usize, since: Instant)
pub fn phase(&self, idx: usize, since: Instant)
2026-09-26: Loop phase idx ran from since until now. An idx of
MAX_PHASES or more lands in the last histogram.
Sourcepub fn sched_tick(&self, shape: &SchedShape)
pub fn sched_tick(&self, shape: &SchedShape)
2026-09-26: This tick’s scheduler shape.
pub fn stream_sync(&self)
pub fn blocking_d2h(&self)
pub fn graph_replay(&self)
pub fn graph_capture(&self)
Sourcepub fn spec_verified(&self, drafts: usize, accepted: usize)
pub fn spec_verified(&self, drafts: usize, accepted: usize)
2026-09-26: A verify step checked drafts drafts and accepted accepted.
Sourcepub fn spec_draft_confidence(&self, lp: f32, accepted: bool)
pub fn spec_draft_confidence(&self, lp: f32, accepted: bool)
2026-10-04: A verify step reached a draft whose drafter top-1 log-probability was
lp, and accepted it or not.
Sourcepub fn request_finished(&self, r: &RequestTiming)
pub fn request_finished(&self, r: &RequestTiming)
2026-09-26: A request finished. Its energy is attributed from the ring window its lifetime spans, only while the device layer is available.
Sourcepub fn step_begin(&self) -> bool
pub fn step_begin(&self) -> bool
2026-09-26: A scheduler step begins. At level Kernel, arms per-kernel
spans on one step in kernel_span_every and returns whether this step
is armed; below Kernel, returns false and changes nothing.
Sourcepub fn kernel_spans_armed(&self) -> bool
pub fn kernel_spans_armed(&self) -> bool
2026-09-26: Whether the kernel launch path should bracket launches this
step. Set by step_begin, cleared by configure.
Sourcepub fn lane_spans(&self) -> bool
pub fn lane_spans(&self) -> bool
2026-09-26: Whether lane spans are recorded (level Kernel).
pub fn lane_names(&self) -> &'static [&'static str]
pub fn device_state(&self) -> DeviceState
2026-09-26: The device layer cannot read. The first why is kept for
Telemetry::device_unavailable_reason.
Sourcepub fn absorb_device(
&self,
tracker: &mut CounterTracker,
reading: &DeviceReading,
read_errors: u64,
)
pub fn absorb_device( &self, tracker: &mut CounterTracker, reading: &DeviceReading, read_errors: u64, )
2026-09-26: Absorb one device reading: publish it and, when it carries the energy counter, advance the energy total; once the ring exists, also push a ring point pairing it with the tokens so far and update the live J/token.
Sourcepub fn device_reading(&self) -> Option<(DeviceReading, u64, u64)>
pub fn device_reading(&self) -> Option<(DeviceReading, u64, u64)>
2026-09-26: The latest device reading, its time, and how many readings
have been stored; None before the first.
Sourcepub fn joules_per_token_cumulative(&self) -> Option<f64>
pub fn joules_per_token_cumulative(&self) -> Option<f64>
2026-09-26: GPU-rail J/token since the first energy sample.
Sourcepub fn tokens_since_first_sample(&self) -> u64
pub fn tokens_since_first_sample(&self) -> u64
2026-09-26: Tokens counted since the first energy sample: the
denominator for Telemetry::energy_mj, which also starts there.