Browse files

Fix args for pollers, initialize class var

  • Loading branch information...
1 parent ba98fdc commit 4bd501221b1568d769d900f60d36d6c0b264350b @kevinclark kevinclark committed May 13, 2008
Showing with 5 additions and 4 deletions.
  1. +4 −4 lib/god/system/process.rb
  2. +1 −0 lib/god/system/slash_proc_poller.rb
View
8 lib/god/system/process.rb
@@ -4,7 +4,7 @@ module System
class Process
def initialize(pid)
@pid = pid.to_i
- @poller = fetch_system_poller
+ @poller = fetch_system_poller.new(@pid)
end
# Return true if this process is running, false otherwise
@@ -14,17 +14,17 @@ def exists?
# Memory usage in kilobytes (resident set size)
def memory
- @poller.memory(@pid)
+ @poller.memory
end
# Percentage memory usage
def percent_memory
- @poller.percent_memory(@pid)
+ @poller.percent_memory
end
# Percentage CPU usage
def percent_cpu
- @poller.percent_cpu(@pid)
+ @poller.percent_cpu
end
private
View
1 lib/god/system/slash_proc_poller.rb
@@ -3,6 +3,7 @@ module System
class SlashProcPoller < PortablePoller
@@kb_per_page = 4 # TODO: Need to make this portable
@@hertz = 100
+ @@total_mem = nil
def initialize(pid)
super(pid)

0 comments on commit 4bd5012

Please sign in to comment.