Skip to content

Commit

Permalink
Simplify filtering node-stats-related documents
Browse files Browse the repository at this point in the history
Closes #534
Relates #540
  • Loading branch information
danielmitterdorfer authored Jul 26, 2018
1 parent f2557f8 commit 9b8974f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions esrally/mechanic/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ def record(self):
for node_stats in current_sample:
node_name = node_stats["name"]
collected_node_stats = collections.OrderedDict()
collected_node_stats["name"] = "node-stats"

if self.include_indices:
collected_node_stats.update(
Expand Down
9 changes: 7 additions & 2 deletions tests/mechanic/telemetry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,11 @@ def test_stores_default_nodes_stats(self, metrics_store_put_doc):
recorder = telemetry.NodeStatsRecorder(telemetry_params, cluster_name="remote", client=client, metrics_store=metrics_store)
recorder.record()

metrics_store_put_doc.assert_called_once_with(NodeStatsRecorderTests.default_stats_response_flattened,
expected_doc = collections.OrderedDict()
expected_doc["name"] = "node-stats"
expected_doc.update(NodeStatsRecorderTests.default_stats_response_flattened)

metrics_store_put_doc.assert_called_once_with(expected_doc,
level=MetaInfoScope.node,
node_name="rally0",
meta_data=metrics_store_meta_data)
Expand Down Expand Up @@ -864,7 +868,8 @@ def test_stores_all_nodes_stats(self, metrics_store_put_doc):
recorder.record()

metrics_store_put_doc.assert_called_once_with(
{"indices_docs_count": 76892364,
{"name": "node-stats",
"indices_docs_count": 76892364,
"indices_docs_deleted": 324530,
"indices_fielddata_evictions": 17,
"indices_fielddata_memory_size_in_bytes": 6936,
Expand Down

0 comments on commit 9b8974f

Please sign in to comment.