#[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
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.