Method: Eye::Controller::Status#debug_data

Defined in:
lib/eye/controller/status.rb

#debug_data(*args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/eye/controller/status.rb', line 3

def debug_data(*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

  res = {
    :about => Eye::ABOUT,
    :resources => Eye::SystemResources.resources($$),
    :ruby => RUBY_DESCRIPTION,
    :gems => %w|Celluloid Celluloid::IO StateMachine NIO Sigar|.map{|c| gem_version(c) },
    :logger => Eye::Logger.args.present? ? [Eye::Logger.dev, *Eye::Logger.args] : Eye::Logger.dev,
    :pid_path => Eye::Local::pid_path,
    :sock_path => Eye::Local::socket_path,
    :actors => actors
  }

  res[:config_yaml] = YAML.dump(current_config.to_h) if h[:config].present?

  res
end