def disk_reads_writes(device):
    with open('/proc/diskstats') as f:
        content = f.read()
    sep = '%s ' % device
    found = False
    for line in content.splitlines():
        if sep in line:
            found = True
            fields = line.strip().split(sep)[1].split()
            num_reads = int(fields[0])
            num_writes = int(fields[4])
            break
    if not found:
        raise DiskError('device not found: %r' % device)
    return (num_reads, num_writes)
Log extra information per iteration based on the collected paths
dataset/ETHPy150Open cgoldberg/linux-metrics/linux_metrics/disk_stat.py/disk_reads_writes--crossover with--dataset/ETHPy150Open rllab/rllab/rllab/baselines/base.py/Baseline.log_diagnostics