add proc_stat.threads
This commit is contained in:
1 parent
e82820a8c5
commit
8ff408bb44
4 files changed
+12
-1
No files matched your search
@@ -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++;
|
||||
|
||||
Reference in new issue
Block a user