add proc_stat.threads

This commit is contained in:
Doug MacEachern committed 2007-10-20 12:49:37 +00:00
1 parent e82820a8c5
commit 8ff408bb44
4 files changed
+12 -1

No files matched your search

+5
View File
@@ -155,6 +155,7 @@ SIGAR_DECLARE(int) sigar_proc_stat_get(sigar_t *sigar,
sigar_proc_list_t proclist;
SIGAR_ZERO(procstat);
procstat->threads = SIGAR_FIELD_NOTIMPL;
if ((status = sigar_proc_list_get(sigar, &proclist)) != SIGAR_OK) {
return status;
@@ -170,6 +171,10 @@ SIGAR_DECLARE(int) sigar_proc_stat_get(sigar_t *sigar,
continue;
}
if (state.threads != SIGAR_FIELD_NOTIMPL) {
procstat->threads += state.threads;
}
switch (state.state) {
case SIGAR_PROC_STATE_IDLE:
procstat->idle++;