Skip to content

Commit

Permalink
Simplify ClusterEnvironmentInfo telemetry device
Browse files Browse the repository at this point in the history
  • Loading branch information
gbanasiak committed Sep 13, 2023
1 parent a2bc19e commit 3623593
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
15 changes: 1 addition & 14 deletions esrally/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ def store_system_metrics(self, node, metrics_store):


def store_node_attribute_metadata(metrics_store, nodes_info):
# push up all node level attributes to cluster level iff the values are identical for all nodes
# push up all node level attributes to cluster level if the values are identical for all nodes
pseudo_cluster_attributes = {}
for node in nodes_info:
if "attributes" in node:
Expand Down Expand Up @@ -1802,7 +1802,6 @@ def on_benchmark_start(self):
return
distribution_flavor = client_info["version"].get("build_flavor", "oss")
# serverless returns dummy build hash which gets overridden when running with operator privileges
# TODO: refactor if config object gets included in telemetry base class (ES-6459)
revision = client_info["version"].get("build_hash", distribution_flavor)
if self.revision_override:
revision = self.revision_override
Expand All @@ -1812,18 +1811,6 @@ def on_benchmark_start(self):
self.metrics_store.add_meta_info(metrics.MetaInfoScope.cluster, None, "distribution_version", distribution_version)
self.metrics_store.add_meta_info(metrics.MetaInfoScope.cluster, None, "distribution_flavor", distribution_flavor)

info = self.client.nodes.info(node_id="_all")
nodes_info = info["nodes"].values()
for node in nodes_info:
node_name = node["name"]
# while we could determine this for bare-metal nodes that are provisioned by Rally, there are other cases (Docker, externally
# provisioned clusters) where it's not that easy.
self.metrics_store.add_meta_info(metrics.MetaInfoScope.node, node_name, "jvm_vendor", extract_value(node, ["jvm", "vm_vendor"]))
self.metrics_store.add_meta_info(metrics.MetaInfoScope.node, node_name, "jvm_version", extract_value(node, ["jvm", "version"]))

store_plugin_metadata(self.metrics_store, nodes_info)
store_node_attribute_metadata(self.metrics_store, nodes_info)


def add_metadata_for_node(metrics_store, node_name, host_name):
"""
Expand Down
10 changes: 0 additions & 10 deletions tests/telemetry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3336,16 +3336,6 @@ def test_stores_cluster_level_metrics_on_attach(self, metrics_store_add_meta_inf
mock.call(metrics.MetaInfoScope.cluster, None, "source_revision", "abc123"),
mock.call(metrics.MetaInfoScope.cluster, None, "distribution_version", "6.0.0-alpha1"),
mock.call(metrics.MetaInfoScope.cluster, None, "distribution_flavor", "oss"),
mock.call(metrics.MetaInfoScope.node, "rally0", "jvm_vendor", "Oracle Corporation"),
mock.call(metrics.MetaInfoScope.node, "rally0", "jvm_version", "1.8.0_74"),
mock.call(metrics.MetaInfoScope.node, "rally1", "jvm_vendor", "Oracle Corporation"),
mock.call(metrics.MetaInfoScope.node, "rally1", "jvm_version", "1.8.0_102"),
mock.call(metrics.MetaInfoScope.node, "rally0", "plugins", ["ingest-geoip"]),
mock.call(metrics.MetaInfoScope.node, "rally1", "plugins", ["ingest-geoip"]),
# can push up to cluster level as all nodes have the same plugins installed
mock.call(metrics.MetaInfoScope.cluster, None, "plugins", ["ingest-geoip"]),
mock.call(metrics.MetaInfoScope.node, "rally0", "attribute_group", "cold_nodes"),
mock.call(metrics.MetaInfoScope.node, "rally1", "attribute_group", "hot_nodes"),
]

metrics_store_add_meta_info.assert_has_calls(calls)
Expand Down

0 comments on commit 3623593

Please sign in to comment.