⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

SchedulerMetrics

Struct SchedulerMetrics 

Source
pub struct SchedulerMetrics {
Show 14 fields pub context_switches: AtomicU64, pub voluntary_switches: AtomicU64, pub involuntary_switches: AtomicU64, pub scheduler_cycles: AtomicU64, pub switch_cycles: AtomicU64, pub schedule_calls: AtomicU64, pub idle_scheduled: AtomicU64, pub avg_switch_latency: AtomicU64, pub min_switch_latency: AtomicU64, pub max_switch_latency: AtomicU64, pub load_balance_count: AtomicU64, pub task_migrations: AtomicU64, pub ipc_blocks: AtomicU64, pub ipc_wakeups: AtomicU64,
}
Expand description

Scheduler performance metrics

Fields§

§context_switches: AtomicU64

Total number of context switches

§voluntary_switches: AtomicU64

Number of voluntary context switches (yield, sleep, block)

§involuntary_switches: AtomicU64

Number of involuntary context switches (preemption)

§scheduler_cycles: AtomicU64

Total CPU cycles spent in scheduler

§switch_cycles: AtomicU64

Total CPU cycles spent in context switching

§schedule_calls: AtomicU64

Number of scheduling decisions made

§idle_scheduled: AtomicU64

Number of times idle task was scheduled

§avg_switch_latency: AtomicU64

Average context switch latency in cycles

§min_switch_latency: AtomicU64

Minimum context switch latency

§max_switch_latency: AtomicU64

Maximum context switch latency

§load_balance_count: AtomicU64

Load balancing operations

§task_migrations: AtomicU64

Task migrations between CPUs

§ipc_blocks: AtomicU64

IPC blocks

§ipc_wakeups: AtomicU64

IPC wakeups

Implementations§

Source§

impl SchedulerMetrics

Source

pub const fn new() -> Self

Create new metrics instance

Source

pub fn record_context_switch(&self, latency_cycles: u64, voluntary: bool)

Record a context switch

Source

pub fn record_scheduler_overhead(&self, cycles: u64)

Record scheduler overhead

Source

pub fn record_idle_scheduled(&self)

Record idle task scheduled

Source

pub fn record_load_balance(&self)

Record load balancing operation

Source

pub fn record_migration(&self)

Record task migration

Source

pub fn record_ipc_block(&self)

Record IPC block

Source

pub fn record_ipc_wakeup(&self)

Record IPC wakeup

Source

pub fn get_summary(&self) -> MetricsSummary

Get summary of metrics

Source

pub fn reset(&self)

Reset all metrics

Trait Implementations§

Source§

impl Default for SchedulerMetrics

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for SchedulerMetrics

§

impl RefUnwindSafe for SchedulerMetrics

§

impl Send for SchedulerMetrics

§

impl Sync for SchedulerMetrics

§

impl Unpin for SchedulerMetrics

§

impl UnwindSafe for SchedulerMetrics

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.