Class: Elastomer::CLI::Node

Inherits:
Base
  • Object
show all
Defined in:
lib/elastomer/cli/node.rb

Instance Method Summary collapse

Instance Method Details

#hot_threadsObject



5
6
7
8
# File 'lib/elastomer/cli/node.rb', line 5

def hot_threads
  response = all_nodes.hot_threads
  puts response
end

#listObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/elastomer/cli/node.rb', line 11

def list
  response = all_nodes.info
  puts Terminal::Table.new(
    :headings => ['NAME', 'HOSTNAME', 'VERSION', 'HTTP ADDRESS', 'ATTRIBUTES'],
    :rows => response["nodes"].collect do |node_id, node|
      [
        node["name"],
        node["host"],
        node["version"],
        node["http_address"],
        node["attributes"]
      ]
    end
  )
end