Permalink
Browse files

also print the process size on the output

  • Loading branch information...
1 parent bd21bee commit 1225d402759764000a90153bc8cd05dec9cf4509 @ripienaar ripienaar committed Sep 30, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 agent/process/mc-pgrep
@@ -52,7 +52,7 @@ ps.list(limits).each_with_index do |result, i|
result[:data][:pslist].each do |proc|
proc[:state] == "Z" ? cmdline = "[#{proc[:cmdline]}]" : cmdline = proc[:cmdline]
- puts " %10s %5d %s" % [proc[:username][0,10], proc[:pid], cmdline[0,60] ] if proc[:cmdline].match limits[:pattern]
+ puts "%5d %-10s %s %s" % [proc[:pid], proc[:username][0,10], proc[:vsize].bytes_to_human, cmdline[0,60] ] if proc[:cmdline].match limits[:pattern]
stats[:count] += 1
stats[:vsize] += proc[:vsize]

0 comments on commit 1225d40

Please sign in to comment.