maitake::scheduler

Struct Tick

Source
#[non_exhaustive]
pub struct Tick { pub polled: usize, pub completed: usize, pub has_remaining: bool, pub spawned: usize, pub woken_external: usize, pub woken_internal: usize, }
Expand description

Metrics recorded during a scheduler tick.

This type is returned by the Scheduler::tick and StaticScheduler::tick methods.

This type bundles together a number of values describing what occurred during a scheduler tick, such as how many tasks were polled, how many of those tasks completed, and how many new tasks were spawned since the last tick.

Most of these values are primarily useful as performance and debugging metrics. However, in some cases, they may also drive system behavior. For example, the has_remaining field on this type indicates whether or not more tasks are left in the scheduler’s run queue after the tick. This can be used to determine whether or not the system should continue ticking the scheduler, or should perform other work before ticking again.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§polled: usize

The total number of tasks polled on this scheduler tick.

§completed: usize

The number of polled tasks that completed on this scheduler tick.

This should always be <= self.polled.

§has_remaining: bool

true if the tick completed with any tasks remaining in the run queue.

§spawned: usize

The number of tasks that were spawned since the last tick.

§woken_external: usize

The number of tasks that were woken from outside of their own poll calls since the last tick.

§woken_internal: usize

The number of tasks that were woken from within their own poll calls during this tick.

Implementations§

Source§

impl Tick

Source

pub fn woken(&self) -> usize

Returns the total number of tasks woken since the last poll.

Trait Implementations§

Source§

impl Debug for Tick

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Tick

§

impl RefUnwindSafe for Tick

§

impl Send for Tick

§

impl Sync for Tick

§

impl Unpin for Tick

§

impl UnwindSafe for Tick

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.