Skip to main content

Module stats

Module stats 

Source
Expand description

What the runtime is doing: a snapshot of every shard’s counters, taken by stats(), or of one runtime’s by Runtime::stats. A runtime built with Builder::record_latencies adds a Histogram of its poll times, and with the io-stats feature each worker’s IO counts and latencies.

The snapshot covers every shard alive in the process: each runtime’s workers, and the shard of each thread that runs block_on (made on its first need, gone with the thread). A shard’s counts are read without stopping it, one at a time, so they need not agree with each other to the operation. Most are counted in the shard’s own memory and published for snapshots: by a shard about to wait for work, so a quiet shard’s are current, and by a busy one at least once every few hundred task runs. Errors are counted as they happen. Taking a snapshot costs a read of each shard’s counters; a running shard pays nothing for it.

Structs§

ErrorCounts
IO errors counted by io::ErrorKind, and two kinds of failure counted apart.
Histogram
A log2 histogram of durations: bucket i counts the samples from 2^i nanoseconds up to (and not including) 2^(i+1); the first bucket also counts samples under a nanosecond.
IoCounts
The IO operations a shard’s thread completed: see ShardStats::io. With the io-stats feature only.
IoLatencies
How long each kind of a shard’s IO operations took, from their submission to the kernel to their completion: see ShardStats::io_latencies.
ShardStats
One shard’s counters. Those marked “published” are as the shard last published them (see the module).
Stats
A snapshot of the runtime’s counters: stats().

Functions§

stats
A snapshot of the counters of every shard alive in the process and of the blocking pools. See Stats.