Class: Moro::Monitor

Inherits:
Object
  • Object
show all
Defined in:
lib/moro/monitor.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Monitor

Returns a new instance of Monitor.



8
9
10
11
12
# File 'lib/moro/monitor.rb', line 8

def initialize(config)
  @config=config
  Moro.logger.info "moro show"
  @processes=get_processes
end

Instance Method Details

#monitObject



21
22
23
24
25
26
27
# File 'lib/moro/monitor.rb', line 21

def monit
  data=[]
  @processes.each do |p|
    data << p.usage
  end
  data
end

#showObject



14
15
16
17
18
19
# File 'lib/moro/monitor.rb', line 14

def show
  data=monit
  data.each do|d|
    puts "#{d[:name]}:#{d[:memory]}"
  end
end