Skip to main content

ShardStats

Struct ShardStats 

Source
#[non_exhaustive]
pub struct ShardStats {
Show 23 fields pub worker: Option<usize>, pub runtime: Option<RuntimeId>, pub backend: IoBackend, pub tasks: usize, pub polls: u64, pub parks: u64, pub parked: Duration, pub busy: Duration, pub queue_depth: usize, pub remote_wakes: u64, pub ops_in_flight: usize, pub cq_overflows: u64, pub buffer_bytes: usize, pub buffer_cap: usize, pub buffer_exhausted: u64, pub timers: usize, pub handoffs: u64, pub longest_poll: Duration, pub budget_yields: u64, pub poll_times: Option<Histogram>, pub io_latencies: Option<IoLatencies>, pub io: Option<IoCounts>, pub errors: ErrorCounts,
}
Expand description

One shard’s counters. Those marked “published” are as the shard last published them (see the module).

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.
§worker: Option<usize>

The shard’s place among its runtime’s workers; None for the shard of a thread that runs block_on.

§runtime: Option<RuntimeId>

The runtime the shard is a worker of; None for the shard of a thread that runs block_on, which serves every runtime the thread enters.

§backend: IoBackend

The kernel interface the shard’s IO runs on.

§tasks: usize

Tasks placed on the shard and not done yet.

§polls: u64

Task polls the shard has run (published).

§parks: u64

Times the shard slept with nothing to run (published).

§parked: Duration

Time the shard spent asleep, in all (published).

§busy: Duration

Time since the shard was made that it did not spend asleep: running tasks, driving its IO and timers, spinning before a park (from the published time asleep).

§queue_depth: usize

Runnables waiting in the shard’s own queue, its LIFO slot included (published).

§remote_wakes: u64

Runnables of the shard’s tasks it took from other threads: a task woken there, or spawned onto it from there (published).

§ops_in_flight: usize

IO operations the shard handed to the kernel that have not ended: on io_uring the operations submitted, on IOCP the ones issued. A readiness poller (epoll, kqueue) hands the kernel none, as its driver makes each call once the descriptor is ready: 0 there (published).

§cq_overflows: u64

Times the shard found completions the kernel was holding for want of room in the ring’s completion queue (none is lost: the kernel keeps them until there is room); 0 on other backends (published).

§buffer_bytes: usize

Bytes the shard’s IO buffers hold: its pool’s, in use and free, and on io_uring its receive buffers’ (published).

§buffer_cap: usize

The most bytes the shard’s IO buffers may hold, its receive buffers included (Builder::io_buffer_cap).

§buffer_exhausted: u64

Times a buffer was wanted while every byte under the pool’s cap was in use; the IO waits for one to come back (published).

§timers: usize

Timers armed on the shard (published).

§handoffs: u64

Times the shard went to another thread because the thread running it stayed in one poll past Builder::handoff_after.

§longest_poll: Duration

The longest poll the runtime saw on the shard, at the resolution of its watch (a quarter of the handoff threshold); zero when no poll lasted that long, or with the handoff off.

§budget_yields: u64

Times a task’s poll on the shard spent its budget of operations and yielded to the shard’s other tasks (see task::coop).

§poll_times: Option<Histogram>

How long each task poll on the shard ran, while its runtime records it (Builder::record_latencies); None when it does not, which is not a shard with no polls.

§io_latencies: Option<IoLatencies>

How long the shard’s IO operations took from their submission to the kernel to their completion, by kind, while its runtime records latencies (Builder::record_latencies); None when it does not, and None on a readiness backend (epoll, kqueue), whose calls are made once the kernel reports the descriptor ready, so there is no wait in the kernel per operation to time. With the io-stats feature only.

§io: Option<IoCounts>

The IO operations the shard’s thread completed, while its runtime counts them (Builder::count_io); None when it does not, which is not a shard that did no IO (published). With the io-stats feature only.

§errors: ErrorCounts

Errors of IO run on the shard.

Trait Implementations§

Source§

impl Clone for ShardStats

Source§

fn clone(&self) -> ShardStats

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShardStats

Source§

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

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.

§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.