Class
PhusionPassenger::AdminTools::ServerInstance::Process

In: | lib/phusion_passenger/admin_tools/server_instance.rb
Parent: | Object

Methods

- connect
- has_metrics?
- new

Constants

INT_PROPERTIES | = | [:pid, :sessions, :processed, :cpu, :rss, :real_memory, :vmsize, :process_group_id]
BOOL_PROPERTIES | = | [:has_metrics]

Attributes

[RW] | command |
[RW] | connect_password |
[RW] | cpu |
[R] | group |
[RW] | gupid |
[RW] | has_metrics |
[RW] | pid |
[RW] | process_group_id |
[RW] | processed |
[RW] | real_memory |
[RW] | rss |
[RW] | server_sockets |
[RW] | sessions |
[RW] | uptime |
[RW] | vmsize |

Public Class methods
new(group)

[ show source ]

        # File lib/phusion_passenger/admin_tools/server_instance.rb, line 82
    82:                 def initialize(group)
    83:                         @group = group
    84:                         @server_sockets = {}
    85:                 end

Public Instance methods
connect(socket_name = :main)

[ show source ]

        # File lib/phusion_passenger/admin_tools/server_instance.rb, line 87
    87:                 def connect(socket_name = :main)
    88:                         socket_info = @server_sockets[socket_name]
    89:                         if !socket_info
    90:                                 raise "This process has no server socket named '#{socket_name}'."
    91:                         end
    92:                         if socket_info.address_type == 'unix'
    93:                                 return UNIXSocket.new(socket_info.address)
    94:                         else
    95:                                 host, port = socket_info.address.split(':', 2)
    96:                                 return TCPSocket.new(host, port.to_i)
    97:                         end
    98:                 end

has_metrics?()

[ show source ]

         # File lib/phusion_passenger/admin_tools/server_instance.rb, line 100
    100:                 def has_metrics?
    101:                         return @has_metrics
    102:                 end