Skip to main content

read_disk_counters

Function read_disk_counters 

Source
pub fn read_disk_counters(root: &Path) -> DiskCounters
Expand description

Read host-wide disk counters from /proc/diskstats.

The authoritative “is this a whole disk” test is the presence of /sys/block/<name>; it is consulted per device, because /proc/diskstats mixes disks and partitions in one file. When /sys is not readable (a fixture tree, a container) the name heuristic is used instead.