pub struct PhaseDetector {
config: PhaseDetectorConfig,
stability: HashMap<u32, PhaseStabilityTracker>,
pub transition_count: u64,
}Expand description
Detects the current workload phase for a given task based on runtime metrics.
Fields§
§config: PhaseDetectorConfig§stability: HashMap<u32, PhaseStabilityTracker>Per-pid stability tracking to debounce phase transitions.
transition_count: u64Phase transition counters for telemetry.
Implementations§
Source§impl PhaseDetector
impl PhaseDetector
pub fn new(config: PhaseDetectorConfig) -> Self
Sourcepub fn detect(&mut self, state: &ZernelTaskState) -> WorkloadPhase
pub fn detect(&mut self, state: &ZernelTaskState) -> WorkloadPhase
Classify the workload phase based on current task state. Uses stability tracking to prevent rapid phase flapping.
Sourcefn detect_raw(&self, state: &ZernelTaskState) -> WorkloadPhase
fn detect_raw(&self, state: &ZernelTaskState) -> WorkloadPhase
Raw phase classification without stability tracking.
Sourcepub fn remove_task(&mut self, pid: u32)
pub fn remove_task(&mut self, pid: u32)
Remove stability tracking for a task.
Auto Trait Implementations§
impl Freeze for PhaseDetector
impl RefUnwindSafe for PhaseDetector
impl Send for PhaseDetector
impl Sync for PhaseDetector
impl Unpin for PhaseDetector
impl UnwindSafe for PhaseDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more