disk i/o metrics for win2k

This commit is contained in:
Doug MacEachern 2005-04-27 18:54:42 +00:00
parent 22452e99fc
commit 05aea8c508
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2005-04-27 Doug MacEachern <dougm@hyperic.net>
* Add disk i/o metrics for Windows 2000
2005-03-15 Doug MacEachern <dougm@hyperic.net> 2005-03-15 Doug MacEachern <dougm@hyperic.net>
* Change Sigar.getMountedFileSystemUsage to throw * Change Sigar.getMountedFileSystemUsage to throw

View File

@ -1528,6 +1528,18 @@ static int get_disk_metrics(sigar_t *sigar,
SIGAR_W2A(name, drive, sizeof(drive)); 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)) { if (strnEQ(drive, dirname, 2)) {
fsusage->disk_reads = PERF_VAL(PERF_IX_DISK_READ); fsusage->disk_reads = PERF_VAL(PERF_IX_DISK_READ);
fsusage->disk_writes = PERF_VAL(PERF_IX_DISK_WRITE); fsusage->disk_writes = PERF_VAL(PERF_IX_DISK_WRITE);