Module: Elasticsearch::API::Nodes::Actions
- Included in:
- NodesClient
- Defined in:
- lib/elasticsearch/api/namespace/nodes.rb,
lib/elasticsearch/api/actions/nodes/info.rb,
lib/elasticsearch/api/actions/nodes/stats.rb,
lib/elasticsearch/api/actions/nodes/shutdown.rb,
lib/elasticsearch/api/actions/nodes/hot_threads.rb
Instance Method Summary collapse
-
#hot_threads(arguments = {}) ⇒ String
Returns information about the hottest threads in the cluster or on a specific node as a String.
-
#info(arguments = {}) ⇒ Object
Returns information about nodes in the cluster (cluster settings, JVM version, etc).
-
#shutdown(arguments = {}) ⇒ Object
Shutdown one or all nodes.
-
#stats(arguments = {}) ⇒ Object
Returns statistical information about nodes in the cluster.
Instance Method Details
#hot_threads(arguments = {}) ⇒ String
Returns information about the hottest threads in the cluster or on a specific node as a String.
The information is returned as text, and allows you to understand what are currently the most taxing operations happening in the cluster, for debugging or monitoring purposes.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/api/actions/nodes/hot_threads.rb', line 28 def hot_threads(arguments={}) valid_params = [ :interval, :snapshots, :threads, :type ] method = HTTP_GET path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), 'hot_threads' params = Utils.__validate_and_extract_params arguments, valid_params body = nil perform_request(method, path, params, body).body end |
#info(arguments = {}) ⇒ Object
Returns information about nodes in the cluster (cluster settings, JVM version, etc).
Use the ‘all` option to return all available settings, or limit the information returned to a specific type (eg. `http`).
Use the ‘node_id` option to limit information to specific node(s).
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/elasticsearch/api/actions/nodes/info.rb', line 41 def info(arguments={}) arguments = arguments.clone metric = arguments.delete(:metric) valid_parts = [ :_all, :http, :jvm, :network, :os, :plugins, :process, :settings, :thread_pool, :transport ] valid_params = [] method = HTTP_GET if metric parts = metric else parts = Utils.__extract_parts arguments, valid_parts end path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), Utils.__listify(parts) params = Utils.__validate_and_extract_params arguments, valid_params body = nil perform_request(method, path, params, body).body end |
#shutdown(arguments = {}) ⇒ Object
Shutdown one or all nodes
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/elasticsearch/api/actions/nodes/shutdown.rb', line 20 def shutdown(arguments={}) valid_params = [ :delay, :exit ] method = HTTP_POST path = Utils.__pathify '_cluster/nodes', Utils.__listify(arguments[:node_id]), '_shutdown' params = Utils.__validate_and_extract_params arguments, valid_params body = nil perform_request(method, path, params, body).body end |
#stats(arguments = {}) ⇒ Object
Returns statistical information about nodes in the cluster.
(options: _all, completion, docs, fielddata, filter_cache, flush, get,
id_cache, indexing, merge, percolate, refresh, search, segments, store,
warmer)
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/elasticsearch/api/actions/nodes/stats.rb', line 43 def stats(arguments={}) arguments = arguments.clone valid_params = [ :metric, :index_metric, :node_id, :completion_fields, :fielddata_fields, :fields, :groups, :human, :level, :types ] method = HTTP_GET path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), 'stats', Utils.__listify(arguments.delete(:metric)), Utils.__listify(arguments.delete(:index_metric)) params = Utils.__validate_and_extract_params arguments, valid_params [:completion_fields, :fielddata_fields, :fields, :groups, :types].each do |key| params[key] = Utils.__listify(params[key]) if params[key] end body = nil perform_request(method, path, params, body).body end |