#[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
impl WorkerMetrics
pub(crate) fn new() -> WorkerMetrics
pub(crate) fn set_queue_depth(&self, len: usize)
pub(crate) fn set_thread_id(&self, thread_id: ThreadId)
pub(crate) fn from_config(_: &Config) -> WorkerMetrics
Trait Implementations§
Source§impl Debug for WorkerMetrics
impl Debug for WorkerMetrics
Source§impl Default for WorkerMetrics
impl Default for WorkerMetrics
Source§fn default() -> WorkerMetrics
fn default() -> WorkerMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for WorkerMetrics
impl RefUnwindSafe for WorkerMetrics
impl Send for WorkerMetrics
impl Sync for WorkerMetrics
impl Unpin for WorkerMetrics
impl UnwindSafe for WorkerMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more