initialize disk metrics for all platforms
This commit is contained in:
parent
dfdff8b635
commit
728fd6d75d
|
@ -193,4 +193,7 @@ int sigar_group_name_get(sigar_t *sigar, int gid, char *buf, int buflen);
|
||||||
return SIGAR_OK; \
|
return SIGAR_OK; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SIGAR_DISK_STATS_NOTIMPL(fsusage) \
|
||||||
|
fsusage->disk_reads = fsusage->disk_writes = SIGAR_FIELD_NOTIMPL
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1383,6 +1383,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->free_files = buf.f_ffree;
|
fsusage->free_files = buf.f_ffree;
|
||||||
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
||||||
|
|
||||||
|
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -604,6 +604,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->free_files = buf.f_files;
|
fsusage->free_files = buf.f_files;
|
||||||
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
||||||
|
|
||||||
|
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -559,6 +559,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->free_files = buf.f_ffree;
|
fsusage->free_files = buf.f_ffree;
|
||||||
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
||||||
|
|
||||||
|
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1229,8 +1229,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fsusage->disk_reads = fsusage->disk_writes =
|
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
||||||
SIGAR_FIELD_NOTIMPL;
|
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -462,6 +462,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->free_files = buf.f_ffree;
|
fsusage->free_files = buf.f_ffree;
|
||||||
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
||||||
|
|
||||||
|
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1133,6 +1133,8 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->free_files = buf.f_files;
|
fsusage->free_files = buf.f_files;
|
||||||
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
||||||
|
|
||||||
|
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,6 +202,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->avail = -1;
|
fsusage->avail = -1;
|
||||||
fsusage->files = -1;
|
fsusage->files = -1;
|
||||||
fsusage->free_files = -1;
|
fsusage->free_files = -1;
|
||||||
|
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1457,8 +1457,7 @@ sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
|
|
||||||
status = get_disk_metrics(sigar, dirname, fsusage);
|
status = get_disk_metrics(sigar, dirname, fsusage);
|
||||||
if (status != SIGAR_OK) {
|
if (status != SIGAR_OK) {
|
||||||
fsusage->disk_reads = fsusage->disk_writes =
|
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
||||||
SIGAR_FIELD_NOTIMPL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
|
|
Loading…
Reference in New Issue