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);