Struct maitake::scheduler::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> 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>,

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more