Skip to main content

disk_rates

Function disk_rates 

Source
pub fn disk_rates(
    prev: &[DiskCounters],
    cur: &[DiskCounters],
    dt_s: f64,
    counted: &dyn Fn(&str) -> bool,
) -> Vec<DiskRate>
Expand description

Each device’s throughput between two snapshots dt_s apart, for the devices counted accepts and that are in both snapshots.

/proc/diskstats lists a device and each of its partitions, and the partitions’ counters are part of the device’s. counted is what keeps a byte from being reported twice (is_whole_device).