Class: PhusionPassenger::AdminTools::ServerInstance::Process
- Defined in:
- lib/phusion_passenger/admin_tools/server_instance.rb
Constant Summary collapse
- INT_PROPERTIES =
[:pid, :sessions, :processed, :cpu, :rss, :real_memory, :vmsize, :process_group_id]
- BOOL_PROPERTIES =
[:has_metrics]
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#connect_password ⇒ Object
Returns the value of attribute connect_password.
-
#cpu ⇒ Object
Returns the value of attribute cpu.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#gupid ⇒ Object
Returns the value of attribute gupid.
-
#has_metrics ⇒ Object
Returns the value of attribute has_metrics.
-
#pid ⇒ Object
Returns the value of attribute pid.
-
#process_group_id ⇒ Object
Returns the value of attribute process_group_id.
-
#processed ⇒ Object
Returns the value of attribute processed.
-
#real_memory ⇒ Object
Returns the value of attribute real_memory.
-
#rss ⇒ Object
Returns the value of attribute rss.
-
#server_sockets ⇒ Object
Returns the value of attribute server_sockets.
-
#sessions ⇒ Object
Returns the value of attribute sessions.
-
#uptime ⇒ Object
Returns the value of attribute uptime.
-
#vmsize ⇒ Object
Returns the value of attribute vmsize.
Instance Method Summary collapse
- #connect(socket_name = :main) ⇒ Object
- #has_metrics? ⇒ Boolean
-
#initialize(group) ⇒ Process
constructor
A new instance of Process.
Constructor Details
#initialize(group) ⇒ Process
Returns a new instance of Process.
82 83 84 85 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 82 def initialize(group) @group = group @server_sockets = {} end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def command @command end |
#connect_password ⇒ Object
Returns the value of attribute connect_password.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def connect_password @connect_password end |
#cpu ⇒ Object
Returns the value of attribute cpu.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def cpu @cpu end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
74 75 76 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 74 def group @group end |
#gupid ⇒ Object
Returns the value of attribute gupid.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def gupid @gupid end |
#has_metrics ⇒ Object
Returns the value of attribute has_metrics.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def has_metrics @has_metrics end |
#pid ⇒ Object
Returns the value of attribute pid.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def pid @pid end |
#process_group_id ⇒ Object
Returns the value of attribute process_group_id.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def process_group_id @process_group_id end |
#processed ⇒ Object
Returns the value of attribute processed.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def processed @processed end |
#real_memory ⇒ Object
Returns the value of attribute real_memory.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def real_memory @real_memory end |
#rss ⇒ Object
Returns the value of attribute rss.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def rss @rss end |
#server_sockets ⇒ Object
Returns the value of attribute server_sockets.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def server_sockets @server_sockets end |
#sessions ⇒ Object
Returns the value of attribute sessions.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def sessions @sessions end |
#uptime ⇒ Object
Returns the value of attribute uptime.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def uptime @uptime end |
#vmsize ⇒ Object
Returns the value of attribute vmsize.
75 76 77 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 75 def vmsize @vmsize end |
Instance Method Details
#connect(socket_name = :main) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 87 def connect(socket_name = :main) socket_info = @server_sockets[socket_name] if !socket_info raise "This process has no server socket named '#{socket_name}'." end if socket_info.address_type == 'unix' return UNIXSocket.new(socket_info.address) else host, port = socket_info.address.split(':', 2) return TCPSocket.new(host, port.to_i) end end |
#has_metrics? ⇒ Boolean
100 101 102 |
# File 'lib/phusion_passenger/admin_tools/server_instance.rb', line 100 def has_metrics? return @has_metrics end |