Skip to content

Commit

Permalink
Update endpoint for CCR stats telemetry device
Browse files Browse the repository at this point in the history
Update the endpoint and the unit tests to reflect the changes brought
in [1].

Also simplify filtering ccr-stats related documents,
similarly to the work done in [2].

[1] elastic/elasticsearch#32350
[2] 9b8974f

Relates #546
  • Loading branch information
dliappis authored Aug 7, 2018
1 parent e2e2cf7 commit 998d862
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 91 deletions.
18 changes: 10 additions & 8 deletions esrally/mechanic/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def record(self):
import elasticsearch

try:
ccr_stats_api_endpoint = "/_xpack/ccr/_stats"
ccr_stats_api_endpoint = "/_ccr/stats"
stats = self.client.transport.perform_request("GET", ccr_stats_api_endpoint, params={"human": "false"})
except elasticsearch.TransportError as e:
msg = "A transport error occurred while collecting CCR stats from the endpoint [{}] on " \
Expand Down Expand Up @@ -410,14 +410,16 @@ def record_stats_per_index(self, name, stats):
:param stats: A dict with returned CCR stats for the index.
"""

for shard_num, shard_stats in stats.items():
shard_metadata = {
"cluster": self.cluster_name,
"index": name,
"shard": shard_num
}
for shard_stats in stats:
if "shard_id" in shard_stats:
shard_metadata = {
"cluster": self.cluster_name,
"index": name,
"shard": shard_stats["shard_id"],
"name": "ccr-stats"
}

self.metrics_store.put_doc(shard_stats, level=MetaInfoScope.cluster, meta_data=shard_metadata)
self.metrics_store.put_doc(shard_stats, level=MetaInfoScope.cluster, meta_data=shard_metadata)


class NodeStats(TelemetryDevice):
Expand Down
Loading

0 comments on commit 998d862

Please sign in to comment.