Class: JayAPI::Elasticsearch::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/jay_api/elasticsearch/stats.rb,
lib/jay_api/elasticsearch/stats/node.rb,
lib/jay_api/elasticsearch/stats/index.rb,
lib/jay_api/elasticsearch/stats/nodes.rb,
lib/jay_api/elasticsearch/stats/indices.rb,
lib/jay_api/elasticsearch/stats/node/storage.rb,
lib/jay_api/elasticsearch/stats/errors/stats_data_not_available.rb

Overview

This class provides access to Elasticsearch’s Cluster Statistic API.

Defined Under Namespace

Modules: Errors Classes: Index, Indices, Node, Nodes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport_client) ⇒ Stats

Returns a new instance of Stats.

Parameters:

  • transport_client (Elasticsearch::Transport::Client)

    The transport client to use to make requests to the cluster.



16
17
18
# File 'lib/jay_api/elasticsearch/stats.rb', line 16

def initialize(transport_client)
  @transport_client = transport_client
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



12
13
14
# File 'lib/jay_api/elasticsearch/stats.rb', line 12

def logger
  @logger
end

#transport_clientObject (readonly)

Returns the value of attribute transport_client.



12
13
14
# File 'lib/jay_api/elasticsearch/stats.rb', line 12

def transport_client
  @transport_client
end

Instance Method Details

#indicesJayAPI::Elasticsearch::Stats::Indices

Returns Information about the indices that exist in the Elasticsearch cluster.

Returns:

Raises:

  • (Elasticsearch::Transport::Transport::ServerError)

    If the request to the Statistics API endpoint fails.



24
25
26
27
# File 'lib/jay_api/elasticsearch/stats.rb', line 24

def indices
  # DO NOT MEMOIZE! Leave it to the caller.
  ::JayAPI::Elasticsearch::Stats::Indices.new(indices_stats['indices'])
end

#nodesJayAPI::Elasticsearch::Stats::Nodes

Returns Information about the nodes that make up the Elasticsearch cluster.

Returns:

Raises:

  • (Elasticsearch::Transport::Transport::ServerError)

    If the request to the Statistics API endpoint fails.



33
34
35
36
# File 'lib/jay_api/elasticsearch/stats.rb', line 33

def nodes
  # DO NOT MEMOIZE! Leave it to the caller.
  ::JayAPI::Elasticsearch::Stats::Nodes.new(nodes_stats['nodes'])
end