Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't write metrics to a closed metrics store #877

Merged
merged 1 commit into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions esrally/mechanic/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ def stop(self, nodes, metrics_store):
stopped_nodes = []
for node in nodes:
node_name = node.node_name
telemetry.add_metadata_for_node(metrics_store, node_name, node.host_name)
if metrics_store:
telemetry.add_metadata_for_node(metrics_store, node_name, node.host_name)
try:
es = psutil.Process(pid=node.pid)
node.telemetry.detach_from_node(node, running=True)
Expand Down Expand Up @@ -239,5 +240,6 @@ def stop(self, nodes, metrics_store):

node.telemetry.detach_from_node(node, running=False)
# store system metrics in any case (telemetry devices may derive system metrics while the node is running)
node.telemetry.store_system_metrics(node, metrics_store)
if metrics_store:
node.telemetry.store_system_metrics(node, metrics_store)
return stopped_nodes
1 change: 1 addition & 0 deletions esrally/mechanic/mechanic.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def stop(cfg):
logging.getLogger(__name__).info("Could not find race [%s] and will thus not persist system metrics.", race_id)
# Don't persist system metrics if we can't retrieve the race as we cannot derive the required meta-data.
current_race = None
metrics_store = None

node_launcher.stop(nodes, metrics_store)
_delete_node_file(root_path)
Expand Down