From a503c1910d2c9b8bf74b3804bf8ff6a9d0d11051 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 6 May 2005 22:51:34 +0000 Subject: [PATCH] implement new disk metrics for linux w/ /proc/partitions metrics --- src/os/linux/linux_sigar.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index fdc497f5..197e745f 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -1113,12 +1113,18 @@ static int get_iostat_procp(sigar_t *sigar, if (strnEQ(ptr, name, len)) { ptr = sigar_skip_token(ptr); /* name */ fsusage->disk_reads = sigar_strtoul(ptr); /* rio */ - /* rmerge, rsect, ruse */ - ptr = sigar_skip_multiple_token(ptr, 3); + ptr = sigar_skip_token(ptr); /* rmerge */ + fsusage->disk_read_bytes = sigar_strtoul(ptr); /* rect */ + ptr = sigar_skip_token(ptr); /* ruse */ + + ptr = sigar_skip_token(ptr); /* wmerge */ + fsusage->disk_write_bytes = sigar_strtoul(ptr); /* wsect */ fsusage->disk_writes = sigar_strtoul(ptr); /* wio */ - fsusage->disk_read_bytes = SIGAR_FIELD_NOTIMPL; - fsusage->disk_write_bytes = SIGAR_FIELD_NOTIMPL; - fsusage->disk_queue = SIGAR_FIELD_NOTIMPL; + /* wuse, running, use */ + ptr = sigar_skip_multiple_token(ptr, 3); + fsusage->disk_queue = sigar_strtoul(ptr); /* aveq */ + fsusage->disk_queue /= 1000; + fclose(fp); return SIGAR_OK; }