Expand description
Disks: how busy the busiest device is and how much each device
reads and writes, from /proc/diskstats; and how full the fullest
filesystem is, from statvfs (SRD-118 §3.2, §3.5).
Structs§
- Disk
Counters - One device’s cumulative counters from
/proc/diskstats. - Disk
Rate - What one device read and wrote over a sample window.
Functions§
- disk_
rates - Each device’s throughput between two snapshots
dt_sapart, for the devicescountedaccepts and that are in both snapshots. - is_
whole_ device - True for a device whose throughput is reported: a whole block
device (it has a directory in
/sys/block; a partition does not) that is not a loop, RAM or compressed-RAM device. - max_
disk_ util - The highest per-device utilization between two diskstats snapshots taken
dt_msapart. Devices present in only one snapshot are skipped (hotplug between samples); an empty intersection yieldsNone. - max_
storage_ util - The fullest
/dev/-backed filesystem right now: (mount point, util). - parse_
dev_ mounts - WRITABLE
/dev/-backed mount points from/proc/mounts, deduplicated by source device (bind mounts and btrfs subvolumes re-list one device many times; space is a per-DEVICE fact). - parse_
device_ numbers - Each block device’s name by its
(major, minor)number, from the text of/proc/diskstats. A control group’sio.statnames a device by number. - parse_
diskstats - Every device’s cumulative counters. Field layout per the kernel’s
Documentation/iostats:
major minor name <stat fields>, where reads completed is stat field 1, sectors read 3, writes completed 5, sectors written 7 and io_ticks 10 (whitespace tokens 3, 5, 7, 9 and 12). - read_
device_ numbers parse_device_numbersof this host. Empty when/proc/diskstatscannot be read.- read_
diskstats - Read
/proc/diskstats. Empty when it cannot be read. - read_
mount_ sizes - Every writable
/dev/-backed filesystem with its size and the space a process without privilege may still take:(mount point, total bytes, available bytes).