Class: Moro::Monitor
- Inherits:
-
Object
- Object
- Moro::Monitor
- Defined in:
- lib/moro/monitor.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Monitor
constructor
A new instance of Monitor.
- #monit ⇒ Object
- #show ⇒ Object
Constructor Details
#initialize(config) ⇒ Monitor
Returns a new instance of Monitor.
8 9 10 11 12 13 |
# File 'lib/moro/monitor.rb', line 8 def initialize(config) @config=config @logger = Logger.new STDOUT @logger.info "moro show" @processes=get_processes end |
Instance Method Details
#monit ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/moro/monitor.rb', line 22 def monit data=[] @processes.each do |p| data << p.usage end data end |
#show ⇒ Object
15 16 17 18 19 20 |
# File 'lib/moro/monitor.rb', line 15 def show data=monit data.each do|d| puts "#{d[:name]}:#{d[:memory]}" end end |