| 1 |
package Search::Elasticsearch::Client::1_0::Direct::Nodes; |
| 2 |
$Search::Elasticsearch::Client::1_0::Direct::Nodes::VERSION = '6.81'; |
| 3 |
use Moo; |
| 4 |
with 'Search::Elasticsearch::Client::1_0::Role::API'; |
| 5 |
with 'Search::Elasticsearch::Role::Client::Direct'; |
| 6 |
__PACKAGE__->_install_api('nodes'); |
| 7 |
|
| 8 |
1; |
| 9 |
|
| 10 |
=pod |
| 11 |
|
| 12 |
=encoding UTF-8 |
| 13 |
|
| 14 |
=head1 NAME |
| 15 |
|
| 16 |
Search::Elasticsearch::Client::1_0::Direct::Nodes - A client for running node-level requests |
| 17 |
|
| 18 |
=head1 VERSION |
| 19 |
|
| 20 |
version 6.81 |
| 21 |
|
| 22 |
=head1 DESCRIPTION |
| 23 |
|
| 24 |
This module provides methods to make node-level requests, such as |
| 25 |
retrieving node info and stats. |
| 26 |
|
| 27 |
It does L<Search::Elasticsearch::Role::Client::Direct>. |
| 28 |
|
| 29 |
=head1 METHODS |
| 30 |
|
| 31 |
=head2 C<info()> |
| 32 |
|
| 33 |
$response = $e->nodes->info( |
| 34 |
node_id => $node_id | \@node_ids # optional |
| 35 |
metric => $metric | \@metrics # optional |
| 36 |
); |
| 37 |
|
| 38 |
The C<info()> method returns static information about the nodes in the |
| 39 |
cluster, such as the configured maximum number of file handles, the maximum |
| 40 |
configured heap size or the threadpool settings. |
| 41 |
|
| 42 |
Allowed metrics are: |
| 43 |
C<http>, |
| 44 |
C<jvm>, |
| 45 |
C<network>, |
| 46 |
C<os>, |
| 47 |
C<plugin>, |
| 48 |
C<process>, |
| 49 |
C<settings>, |
| 50 |
C<thread_pool>, |
| 51 |
C<transport> |
| 52 |
|
| 53 |
Query string parameters: |
| 54 |
C<flat_settings>, |
| 55 |
C<human> |
| 56 |
|
| 57 |
See the L<node_info docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html> |
| 58 |
for more information. |
| 59 |
|
| 60 |
=head2 C<stats()> |
| 61 |
|
| 62 |
$response = $e->nodes->stats( |
| 63 |
node_id => $node_id | \@node_ids # optional |
| 64 |
metric => $metric | \@metrics # optional |
| 65 |
index_metric => $ind_metric | \@ind_metrics # optional |
| 66 |
); |
| 67 |
|
| 68 |
The C<stats()> method returns statistics about the nodes in the |
| 69 |
cluster, such as the number of currently open file handles, the current |
| 70 |
heap memory usage or the current number of threads in use. |
| 71 |
|
| 72 |
Stats can be returned for all nodes, or limited to particular nodes |
| 73 |
with the C<node_id> parameter. By default all metrics are returned, but |
| 74 |
these can be limited to those specified in the C<metric> parameter. |
| 75 |
|
| 76 |
Allowed metrics are: |
| 77 |
C<_all>, |
| 78 |
C<breaker>, |
| 79 |
C<fs>, |
| 80 |
C<http>, |
| 81 |
C<indices>, |
| 82 |
C<jvm>, |
| 83 |
C<network>, |
| 84 |
C<os>, |
| 85 |
C<process>, |
| 86 |
C<thread_pool>, |
| 87 |
C<transport> |
| 88 |
|
| 89 |
If the C<indices> metric (or C<_all>) is specified, then |
| 90 |
L<indices_stats|Search::Elasticsearch::Client::1_0::Direct::Indices/indices_stats()> |
| 91 |
information is returned on a per-node basis. Which indices stats are |
| 92 |
returned can be controlled with the C<index_metric> parameter: |
| 93 |
|
| 94 |
$response = $e->cluster->node_stats( |
| 95 |
node_id => 'node_1', |
| 96 |
metric => ['indices','fs'] |
| 97 |
index_metric => ['docs','fielddata'] |
| 98 |
); |
| 99 |
|
| 100 |
Allowed index metrics are: |
| 101 |
C<_all>, |
| 102 |
C<completion> |
| 103 |
C<docs>, |
| 104 |
C<fielddata>, |
| 105 |
C<filter_cache>, |
| 106 |
C<flush>, |
| 107 |
C<get>, |
| 108 |
C<id_cache>, |
| 109 |
C<indexing>, |
| 110 |
C<merge>, |
| 111 |
C<percolate>, |
| 112 |
C<query_cache>, |
| 113 |
C<refresh>, |
| 114 |
C<search>, |
| 115 |
C<segments>, |
| 116 |
C<store>, |
| 117 |
C<warmer> |
| 118 |
|
| 119 |
Query string parameters: |
| 120 |
C<completion_fields>, |
| 121 |
C<fielddata_fields>, |
| 122 |
C<fields>, |
| 123 |
C<groups>, |
| 124 |
C<human>, |
| 125 |
C<level>, |
| 126 |
C<types> |
| 127 |
|
| 128 |
See the L<node_stats docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html> |
| 129 |
for more information. |
| 130 |
|
| 131 |
=head2 C<hot_threads()> |
| 132 |
|
| 133 |
$response = $e->nodes->hot_threads( |
| 134 |
node_id => $node_id | \@node_ids # optional |
| 135 |
) |
| 136 |
|
| 137 |
The C<hot_threads()> method is a useful tool for diagnosing busy nodes. It |
| 138 |
takes a snapshot of which threads are consuming the most CPU. |
| 139 |
|
| 140 |
Query string parameters: |
| 141 |
C<ignore_idle_threads>, |
| 142 |
C<interval>, |
| 143 |
C<snapshots>, |
| 144 |
C<threads>, |
| 145 |
C<type> |
| 146 |
|
| 147 |
See the L<hot_threads docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html> |
| 148 |
for more information. |
| 149 |
|
| 150 |
=head2 C<shutdown()> |
| 151 |
|
| 152 |
$e->nodes->shutdown( |
| 153 |
node_id => $node_id | \@node_ids # optional |
| 154 |
); |
| 155 |
|
| 156 |
The C<shutdown()> method is used to shutdown one or more nodes, or the whole |
| 157 |
cluster. |
| 158 |
|
| 159 |
Query string parameters: |
| 160 |
C<delay>, |
| 161 |
C<exit> |
| 162 |
|
| 163 |
See the L<shutdown docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-shutdown.html> |
| 164 |
for more information. |
| 165 |
|
| 166 |
=head1 AUTHOR |
| 167 |
|
| 168 |
Enrico Zimuel <[email protected]> |
| 169 |
|
| 170 |
=head1 COPYRIGHT AND LICENSE |
| 171 |
|
| 172 |
This software is Copyright (c) 2020 by Elasticsearch BV. |
| 173 |
|
| 174 |
This is free software, licensed under: |
| 175 |
|
| 176 |
The Apache License, Version 2.0, January 2004 |
| 177 |
|
| 178 |
=cut |
| 179 |
|
| 180 |
__END__ |
| 181 |
|
| 182 |
# ABSTRACT: A client for running node-level requests |
| 183 |
|