Skip to content

[JAY-656] Add a way to access the Elasticsearch cluster's node-related statistics#30

Merged
sergio-bobillier merged 5 commits into
masterfrom
sb-JAY-656-nodes-stats
May 30, 2025
Merged

[JAY-656] Add a way to access the Elasticsearch cluster's node-related statistics#30
sergio-bobillier merged 5 commits into
masterfrom
sb-JAY-656-nodes-stats

Conversation

@sergio-bobillier

Copy link
Copy Markdown
Collaborator

This pull request adds the necessary classes to allow the user to access the Elasticsearch cluster's node-related statistics. For the moment only information about the nodes' storage can be accessed. More information will probably be accessible in the future.

The Storage class has ben equipped with a + operator in order to allow clients to easily calculate the total storage on the cluster, by adding together the storage data for each of the nodes.

Comment thread lib/jay_api/elasticsearch/stats/node/storage.rb

@albertoberto albertoberto left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First line of the commit message: "done" instead of "dome"

EDIT: I see it does not specify which commit :) I meant the first one

@albertoberto albertoberto left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second commit: "holds" instead of "hold" In the first line of the commit message

Comment thread lib/jay_api/elasticsearch/stats/node/storage.rb
Comment thread lib/jay_api/elasticsearch/stats/node/storage.rb
Comment thread lib/jay_api/elasticsearch/stats/node/storage.rb
Comment thread lib/jay_api/elasticsearch/stats/nodes.rb Outdated
Comment thread lib/jay_api/elasticsearch/stats/nodes.rb Outdated
Comment thread lib/jay_api/elasticsearch/stats/nodes.rb

@albertoberto albertoberto left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed all 5 commits but I guess if I hit "Approve" then I'd approve the whole PR

This is being done because the index-related statistics are not the only
statistics that the API can deliver. In an upcoming commit node-related
statistics will be needed, then a single #response method will no longer
be suitable.
The class holds information about the storage space available on one of
the nodes that make up the Elasticsearch cluster. It will be used in an
upcoming commit to provide the user access to said information.
The class holds information about one of the nodes that make up the
Elasticsearch cluster. For the moment it only provides the #storage
method, which gives the caller access to storage-related information
about the node.

The class will be used in an upcoming commit to give the user access to
said data through the Elasticsearch::Client class.
The class holds the information for each of the nodes that make up the
Elasticsearch cluster. It acts as a collection of Node objects, one for
each node.

The class uses a lazy enumerator to avoid instantiating Node objects
needlessly, they are only initialized when they are accessed.

The class will be used in an upcoming commit to give the user access to
node-related statistics through the Elasticsearch::Client class.
The method returns an instance of Elasticsearch::Stats::Nodes, a class
which allows the caller to access information about the nodes that make
up the Elasticsearch cluster.
@sergio-bobillier sergio-bobillier merged commit c3a66c9 into master May 30, 2025
3 checks passed
@sergio-bobillier sergio-bobillier deleted the sb-JAY-656-nodes-stats branch May 30, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants