Pruning out pids which are no longer present

This commit is contained in:
Diptanu Choudhury
2016-06-11 01:40:52 +02:00
parent d31034941a
commit 446d3f22f2
3 changed files with 19 additions and 11 deletions

View File

@@ -43,7 +43,7 @@ func (e *UniversalExecutor) Stats() (*cstructs.TaskResourceUsage, error) {
return e.aggregatedResourceUsage(pidStats), nil
}
func (e *UniversalExecutor) getAllPids() ([]*nomadPid, error) {
func (e *UniversalExecutor) getAllPids() (map[int]*nomadPid, error) {
allProcesses, err := ps.Processes()
if err != nil {
return nil, err