Module: Eye::Controller::Status

Included in:
Eye::Controller
Defined in:
lib/eye/controller/status.rb

Instance Method Summary collapse

Instance Method Details

#info_data(*args) ⇒ Object



39
40
41
# File 'lib/eye/controller/status.rb', line 39

def info_data(*args)
  {:subtree => info_objects(*args).map{|a| a.status_data } }
end

#info_string(*args) ⇒ Object



3
4
5
# File 'lib/eye/controller/status.rb', line 3

def info_string(*args)
  make_str(info_data(*args)).to_s
end

#info_string_debug(*args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/eye/controller/status.rb', line 11

def info_string_debug(*args)
  h = args.extract_options!
  actors = Celluloid::Actor.all.map{|actor| actor.__klass__ }.group_by{|a| a}.map{|k,v| [k, v.size]}.sort_by{|a|a[1]}.reverse

  str = <<-S
About:  #{Eye::ABOUT}
Info:   #{resources_str(Eye::SystemResources.resources($$))}
Ruby:   #{RUBY_DESCRIPTION}
Gems:   #{%w|Celluloid Celluloid::IO ActiveSupport StateMachine NIO|.map{|c| gem_version(c) }}
Checks: #{Eye::Checker::TYPES}, #{Eye::Trigger::TYPES}
Logger: #{Eye::Logger.dev}
Socket: #{Eye::Settings::socket_path}
Pid:    #{Eye::Settings::pid_path}
Actors: #{actors.inspect}

  S

  str += make_str(info_data_debug) + "\n" if h[:processes].present?

  if h[:config].present?
    str += "\nCurrent config: \n"
    str += YAML.dump(current_config.to_h)
  end

  GC.start
  str
end

#info_string_short(*args) ⇒ Object



7
8
9
# File 'lib/eye/controller/status.rb', line 7

def info_string_short(*args)
  make_str({:subtree => @applications.map{|a| a.status_data_short } }).to_s
end