Skip to content

Commit e72800a

Browse files
committed
procstat: report 0 if the process can't be found anymore
otherwise would keep reporting the last good known values even after the monitored process has been shutdown.
1 parent 47e15ed commit e72800a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

procstat/python_modules/procstat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ def update_stats():
283283
(ppid, pgid) = get_pgid(proc)
284284
except Exception, e:
285285
logging.warning(' failed getting pgid: ' + str(e))
286+
stats[proc]['cpu'] = 0.0
287+
stats[proc]['mem'] = 0
286288
continue
287289

288290
# save for later

0 commit comments

Comments
 (0)