pub struct EventEngine { /* private fields */ }Implementations§
Source§impl EventEngine
impl EventEngine
pub fn new() -> Self
Sourcepub fn register_device(&mut self, id: DeviceId, short_name: String)
pub fn register_device(&mut self, id: DeviceId, short_name: String)
Register a friendly short name (“GPU0”) used in narration.
Sourcepub fn observe(
&mut self,
device: &DeviceId,
sample: &DynamicSample,
processes: Option<&[ProcessSample]>,
mem_total: Option<u64>,
temp_slowdown_c: Option<f32>,
) -> Vec<Event>
pub fn observe( &mut self, device: &DeviceId, sample: &DynamicSample, processes: Option<&[ProcessSample]>, mem_total: Option<u64>, temp_slowdown_c: Option<f32>, ) -> Vec<Event>
Derive this tick’s events.
processes is None when the process list was unobservable — the backend’s
process probe failed outright. That is emphatically not the same as Some(&[]),
which asserts the device really had no processes: an empty list makes every
previously-seen pid look like it exited, and process_events would narrate a
fact-grade “python (pid 4521) left GPU0, freeing 21.3 GiB” off a driver hiccup.
Fact-grade narration of an event that never happened is the failure mode this
project treats as fatal, so the unobservable case gets its own arm: the four
process-dependent derivations are skipped, and any inference resting on
continuous process observation is reset, because this tick broke that premise.
Device-level derivations (throttle, VRAM pressure) are unaffected and keep running.