From 05aea8c50812b19215cf1c52e62388c39e8fa497 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 27 Apr 2005 18:54:42 +0000 Subject: [PATCH] disk i/o metrics for win2k --- ChangeLog | 4 ++++ src/os/win32/win32_sigar.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index efe1bf29..6e5c3016 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-04-27 Doug MacEachern + + * Add disk i/o metrics for Windows 2000 + 2005-03-15 Doug MacEachern * Change Sigar.getMountedFileSystemUsage to throw diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index e6b04187..00e568e3 100644 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -1528,6 +1528,18 @@ static int get_disk_metrics(sigar_t *sigar, SIGAR_W2A(name, drive, sizeof(drive)); + if (sigar_isdigit(*name)) { + char *ptr = strchr(drive, ' '); /* 2000 Server "0 C:" */ + + if (ptr) { + ++ptr; + SIGAR_SSTRCPY(drive, ptr); + } + else { + /* XXX NT is a number only "0", how to map? */ + } + } + if (strnEQ(drive, dirname, 2)) { fsusage->disk_reads = PERF_VAL(PERF_IX_DISK_READ); fsusage->disk_writes = PERF_VAL(PERF_IX_DISK_WRITE);