Struct WorkerMetrics

Source
#[repr(align(128))]
pub(crate) struct WorkerMetrics { pub(crate) busy_duration_total: MetricAtomicU64, pub(crate) queue_depth: MetricAtomicUsize, thread_id: Mutex<Option<ThreadId>>, pub(crate) park_count: MetricAtomicU64, pub(crate) park_unpark_count: MetricAtomicU64, }
Expand description

Retrieve runtime worker metrics.

Note: This is an unstable API. The public API of this type may break in 1.x releases. See the documentation on unstable features for details.

Fields§

§busy_duration_total: MetricAtomicU64

Amount of time the worker spent doing work vs. parking.

§queue_depth: MetricAtomicUsize

Number of tasks currently in the local queue. Used only by the current-thread scheduler.

§thread_id: Mutex<Option<ThreadId>>

Thread id of worker thread.

§park_count: MetricAtomicU64

Number of times the worker parked.

§park_unpark_count: MetricAtomicU64

Number of times the worker parked and unparked.

Implementations§

Source§

impl WorkerMetrics

Source

pub(crate) fn new() -> WorkerMetrics

Source

pub(crate) fn set_queue_depth(&self, len: usize)

Source

pub(crate) fn set_thread_id(&self, thread_id: ThreadId)

Source

pub(crate) fn from_config(_: &Config) -> WorkerMetrics

Trait Implementations§

Source§

impl Debug for WorkerMetrics

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for WorkerMetrics

Source§

fn default() -> WorkerMetrics

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

Auto Trait Implementations§

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