diff --git a/include/sigar.h b/include/sigar.h index 00aa508f..d72b7715 100644 --- a/include/sigar.h +++ b/include/sigar.h @@ -445,6 +445,8 @@ typedef struct { disk_write_bytes, disk_read_bytes, disk_queue, + disk_rtime, + disk_wtime, disk_time; double use_percent; } sigar_file_system_usage_t; diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index fb5c819b..92ddeb5c 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -1379,6 +1379,9 @@ static int get_iostat_proc_dstat(sigar_t *sigar, &aveq); /* 11 # of millis spent doing I/Os (weighted) */ if (num == 11) { + fsusage->disk_rtime = ruse; + fsusage->disk_wtime = wuse; + fsusage->disk_time = use; fsusage->disk_queue = aveq / 1000; } else if (num == 4) { @@ -1400,8 +1403,6 @@ static int get_iostat_proc_dstat(sigar_t *sigar, fsusage->disk_read_bytes *= 512; fsusage->disk_write_bytes *= 512; - fsusage->disk_time = use; - fclose(fp); return status; } @@ -1454,12 +1455,11 @@ static int get_iostat_procp(sigar_t *sigar, fsusage->disk_reads = sigar_strtoull(ptr); /* rio */ ptr = sigar_skip_token(ptr); /* rmerge */ fsusage->disk_read_bytes = sigar_strtoull(ptr); /* rsect */ - ptr = sigar_skip_token(ptr); /* ruse */ - + fsusage->disk_rtime = sigar_strtoull(ptr); /* ruse */ ptr = sigar_skip_token(ptr); /* wmerge */ fsusage->disk_write_bytes = sigar_strtoull(ptr); /* wsect */ fsusage->disk_writes = sigar_strtoull(ptr); /* wio */ - ptr = sigar_skip_token(ptr); /* wuse */ + fsusage->disk_wtime = sigar_strtoull(ptr); /* wuse */ ptr = sigar_skip_token(ptr); /* running */ fsusage->disk_time = sigar_strtoull(ptr); /* use */ fsusage->disk_queue = sigar_strtoull(ptr); /* aveq */