Module: Eye::Controller::Status
- Included in:
- Eye::Controller
- Defined in:
- lib/eye/controller/status.rb
Instance Method Summary collapse
- #info_data(mask = nil) ⇒ Object
- #info_data_debug(mask = nil) ⇒ Object
- #info_objects(mask = nil) ⇒ Object
- #info_string(mask = nil) ⇒ Object
- #info_string_debug(show_config = false, show_processes = false) ⇒ Object
- #info_string_short ⇒ Object
Instance Method Details
#info_data(mask = nil) ⇒ Object
10 11 12 |
# File 'lib/eye/controller/status.rb', line 10 def info_data(mask = nil) {:subtree => info_objects(mask).map{|a| a.status_data } } end |
#info_data_debug(mask = nil) ⇒ Object
14 15 16 |
# File 'lib/eye/controller/status.rb', line 14 def info_data_debug(mask = nil) {:subtree => info_objects(mask).map{|a| a.status_data(true) } } end |
#info_objects(mask = nil) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/eye/controller/status.rb', line 3 def info_objects(mask = nil) res = [] return @applications unless mask matched_objects(mask){|obj| res << obj } res end |
#info_string(mask = nil) ⇒ Object
18 19 20 |
# File 'lib/eye/controller/status.rb', line 18 def info_string(mask = nil) make_str(info_data(mask)).to_s end |
#info_string_debug(show_config = false, show_processes = false) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/eye/controller/status.rb', line 26 def info_string_debug(show_config = false, show_processes = false) actors = Celluloid::Actor.all.map{|actor| actor.instance_variable_get(:@klass) }.group_by{|a| a}.map{|k,v| [k, v.size]}.sort_by{|a|a[1]}.reverse str = "About: \#{Eye::ABOUT}\nInfo: \#{resources_str(Eye::SystemResources.resources($$), false)}\nRuby: \#{RUBY_DESCRIPTION}\nLogger: \#{Eye::Logger.dev}\nSocket: \#{Eye::Settings::socket_path}\nPid: \#{Eye::Settings::pid_path}\nActors: \#{actors.inspect}\n\n S\n\n str += make_str(info_data_debug) + \"\\n\" if show_processes.present?\n\n if show_config.present?\n str += \"\\nCurrent config: \\n\"\n str += YAML.dump(current_config.to_h)\n end\n\n GC.start\n str\nend\n" |
#info_string_short ⇒ Object
22 23 24 |
# File 'lib/eye/controller/status.rb', line 22 def info_string_short make_str({:subtree => @applications.map{|a| a.status_data_short } }).to_s end |