Support I (idle) process state on procfs+Linux (#3530)
(cherry picked from commit 663a5b1f50)
This commit is contained in:
committed by
Daniel Nelson
parent
ecf43f4986
commit
fdb04702eb
@@ -85,6 +85,7 @@ func getEmptyFields() map[string]interface{} {
|
||||
fields["dead"] = int64(0)
|
||||
fields["paging"] = int64(0)
|
||||
fields["total_threads"] = int64(0)
|
||||
fields["idle"] = int64(0)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
@@ -174,6 +175,8 @@ func (p *Processes) gatherFromProc(fields map[string]interface{}) error {
|
||||
fields["stopped"] = fields["stopped"].(int64) + int64(1)
|
||||
case 'W':
|
||||
fields["paging"] = fields["paging"].(int64) + int64(1)
|
||||
case 'I':
|
||||
fields["idle"] = fields["idle"].(int64) + int64(1)
|
||||
default:
|
||||
log.Printf("I! processes: Unknown state [ %s ] in file %s",
|
||||
string(stats[0][0]), filename)
|
||||
|
||||
Reference in New Issue
Block a user