use std::sync::atomic::Ordering::Relaxed; use std::time::{Duration, Instant};
pub(crate) struct MetricsBatch { /// The total busy duration in nanoseconds.
busy_duration_total: u64,
/// Instant at which work last resumed (continued after park).
processing_scheduled_tasks_started_at: Option<Instant>,
/// Number of times the worker parked.
park_count: u64,
/// Number of times the worker parked and unparked.
park_unpark_count: u64,
#[cfg(tokio_unstable)] /// Number of times the worker woke w/o doing work.
noop_count: u64,
#[cfg(tokio_unstable)] /// Number of tasks stolen.
steal_count: u64,
#[cfg(tokio_unstable)] /// Number of times tasks where stolen.
steal_operations: u64,
#[cfg(tokio_unstable)] /// Number of tasks that were polled by the worker.
poll_count: u64,
#[cfg(tokio_unstable)] /// Number of tasks polled when the worker entered park. This is used to /// track the noop count.
poll_count_on_last_park: u64,
#[cfg(tokio_unstable)] /// Number of tasks that were scheduled locally on this worker.
local_schedule_count: u64,
#[cfg(tokio_unstable)] /// Number of tasks moved to the global queue to make space in the local /// queue
overflow_count: u64,
#[cfg(tokio_unstable)] /// If `Some`, tracks poll times in nanoseconds
poll_timer: Option<PollTimer>,
}
cfg_unstable_metrics! { struct PollTimer { /// Histogram of poll counts within each band.
poll_counts: HistogramBatch,
/// Instant when the most recent task started polling.
poll_started_at: Instant,
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.