Class: MMTop::HostInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/mmtop/host.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, processlist, slave_status, stats) ⇒ HostInfo

Returns a new instance of HostInfo.



115
116
117
118
119
120
121
# File 'lib/mmtop/host.rb', line 115

def initialize(host, processlist, slave_status, stats)
  @host = host
  @connections = processlist.clone
  @slave_status = slave_status
  @stats = stats
  @processlist = processlist
end

Instance Attribute Details

#connectionsObject (readonly)

Returns the value of attribute connections.



126
127
128
# File 'lib/mmtop/host.rb', line 126

def connections
  @connections
end

#hostObject (readonly)

Returns the value of attribute host.



126
127
128
# File 'lib/mmtop/host.rb', line 126

def host
  @host
end

#slave_statusObject (readonly)

Returns the value of attribute slave_status.



126
127
128
# File 'lib/mmtop/host.rb', line 126

def slave_status
  @slave_status
end

#statsObject (readonly)

Returns the value of attribute stats.



126
127
128
# File 'lib/mmtop/host.rb', line 126

def stats
  @stats
end

Instance Method Details

#processlistObject



123
124
125
# File 'lib/mmtop/host.rb', line 123

def processlist
  @p ||= @processlist.select { |p| !p.status.nil? && !p.status.empty? }
end