Skip to main content

io

Function io 

Source
pub fn io() -> Result<DiskIo>
Expand description

Disk activity over the next second, every physical disk together. Blocks for DEFAULT_WINDOW; a monitor keeps an IoSampler.

Only physical disks are counted (partitions, device-mapper and RAID members, loop, RAM, and zram devices are left out), so nothing is counted twice. Inside a container the disks are the host’s; this process’s own I/O is process::io.

let io = sys_lib::disk::io()?;            // blocks 1 s
println!("read {} write {} ({:.0} IOPS, busy {:?})", io.read, io.write, io.reads_per_sec + io.writes_per_sec, io.busy);

§Errors

As IoSampler::sample.