initialize disk metrics for all platforms

This commit is contained in:
Doug MacEachern 2004-12-05 23:42:23 +00:00
parent dfdff8b635
commit 728fd6d75d
9 changed files with 16 additions and 4 deletions

View File

@ -193,4 +193,7 @@ int sigar_group_name_get(sigar_t *sigar, int gid, char *buf, int buflen);
return SIGAR_OK; \
}
#define SIGAR_DISK_STATS_NOTIMPL(fsusage) \
fsusage->disk_reads = fsusage->disk_writes = SIGAR_FIELD_NOTIMPL
#endif

View File

@ -1383,6 +1383,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
fsusage->free_files = buf.f_ffree;
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
SIGAR_DISK_STATS_NOTIMPL(fsusage);
return SIGAR_OK;
}

View File

@ -604,6 +604,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
fsusage->free_files = buf.f_files;
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
SIGAR_DISK_STATS_NOTIMPL(fsusage);
return SIGAR_OK;
}

View File

@ -559,6 +559,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
fsusage->free_files = buf.f_ffree;
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
SIGAR_DISK_STATS_NOTIMPL(fsusage);
return SIGAR_OK;
}

View File

@ -1229,8 +1229,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
break;
}
fsusage->disk_reads = fsusage->disk_writes =
SIGAR_FIELD_NOTIMPL;
SIGAR_DISK_STATS_NOTIMPL(fsusage);
return SIGAR_OK;
}

View File

@ -462,6 +462,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
fsusage->free_files = buf.f_ffree;
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
SIGAR_DISK_STATS_NOTIMPL(fsusage);
return SIGAR_OK;
}

View File

@ -1133,6 +1133,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
fsusage->free_files = buf.f_files;
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
SIGAR_DISK_STATS_NOTIMPL(fsusage);
return SIGAR_OK;
}

View File

@ -202,6 +202,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
fsusage->avail = -1;
fsusage->files = -1;
fsusage->free_files = -1;
SIGAR_DISK_STATS_NOTIMPL(fsusage);
return SIGAR_OK;
}

View File

@ -1457,8 +1457,7 @@ sigar_file_system_usage_get(sigar_t *sigar,
status = get_disk_metrics(sigar, dirname, fsusage);
if (status != SIGAR_OK) {
fsusage->disk_reads = fsusage->disk_writes =
SIGAR_FIELD_NOTIMPL;
SIGAR_DISK_STATS_NOTIMPL(fsusage);
}
return SIGAR_OK;