Class: RequireProf::MemorySampler::ShellPS
- Inherits:
-
Object
- Object
- RequireProf::MemorySampler::ShellPS
- Defined in:
- lib/require_prof/memory_sampler.rb
Instance Method Summary collapse
-
#initialize(command) ⇒ ShellPS
constructor
A new instance of ShellPS.
- #memory_usage ⇒ Object
Constructor Details
#initialize(command) ⇒ ShellPS
Returns a new instance of ShellPS.
52 53 54 |
# File 'lib/require_prof/memory_sampler.rb', line 52 def initialize(command) @command = command end |
Instance Method Details
#memory_usage ⇒ Object
56 57 58 59 |
# File 'lib/require_prof/memory_sampler.rb', line 56 def memory_usage process = $$ `#{@command} #{process}`.split("\n")[1].to_f rescue 0.0 end |