Skip to content

Commit

Permalink
fix(nodes list in email): address comments #1
Browse files Browse the repository at this point in the history
  • Loading branch information
juliayakovlev authored and Bentsi committed Mar 30, 2021
1 parent 522cf6b commit 8b96732
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
16 changes: 14 additions & 2 deletions sdcm/report_templates/results_issue_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@
{% if live_nodes_shards %}
Scylla running with shards number (live nodes):<br>
{% for shards_info in live_nodes_shards %}
&nbsp;&nbsp;{{ shards_info.name }} ({{ shards_info.ip }}): {{ shards_info.shards }} shards<br>
{% if loop.length > 10 %}
&nbsp;&nbsp;&nbsp;There are {{ loop.length }} nodes in the cluster.
The list is so long and won't be printed in the email<br><br>
{% break %}
{% else %}
&nbsp;&nbsp; {{ shards_info.name }} ({{ shards_info.ip }}): {{ shards_info.shards }} shards<br><br>
{% endif %}
{% endfor %}
{% endif %}
{% if dead_nodes_shards %}
Scylla running with shards number (terminated nodes):<br>
{% for shards_info in dead_nodes_shards %}
&nbsp;&nbsp;{{ shards_info.name }} ({{ shards_info.ip }}): {{ shards_info.shards }} shards<br>
{% if loop.length > 10 %}
&nbsp;&nbsp;&nbsp;There are {{ loop.length }} nodes in the cluster.
The list is so long and won't be printed in the email<br><br>
{% break %}
{% else %}
&nbsp;&nbsp; {{ shards_info.name }} ({{ shards_info.ip }}): {{ shards_info.shards }} shards<br><br>
{% endif %}
{% endfor %}
{% endif %}
OS (RHEL/CentOS/Ubuntu/AWS AMI): {% if scylla_ami_id %} `{{ scylla_ami_id }}` {% endif %} {% if scylla_node_image %} `{{ scylla_node_image }}`{% endif %} ({{ backend }}{% if region_name %}: {{ region_name }}{% endif %})<br>
Expand Down
42 changes: 29 additions & 13 deletions sdcm/report_templates/results_longevity.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ <h4>Live nodes (at the end of the test)</h4>
<th>Scylla shards</th>
</tr>
{% for node in live_nodes_shards %}
<tr>
<td>{{ node.name }}</td>
<td>{{ node.ip }}</td>
<td>{{ node.shards }}</td>
</tr>
{% if loop.length > 10 %}
<tr>
<td colspan="3">There are {{ loop.length }} nodes in the cluster.
The list is so long and won't be printed in the email</td>
</tr>
{% break %}
{% else %}
<tr>
<td>{{ node.name }}</td>
<td>{{ node.ip }}</td>
<td>{{ node.shards }}</td>
</tr>
{% endif %}
{% endfor %}
</table>
</div>
Expand All @@ -42,14 +50,22 @@ <h4>Terminated nodes</h4>
<th>Terminated by nemesis</th>
</tr>
{% for node in dead_nodes_shards %}
<tr>
<td>{{ node.name }}</td>
<td>{{ node.ip }}</td>
<td>{{ node.shards }}</td>
<td>{{ node.termination_time }}</td>
<td>{{ node.terminated_by_nemesis }}</td>
</tr>
{% endfor %}
{% if loop.length > 10 %}
<tr>
<td colspan="5">There are {{ loop.length }} nodes in the cluster.
The list is so long and won't be printed in the email</td>
</tr>
{% break %}
{% else %}
<tr>
<td>{{ node.name }}</td>
<td>{{ node.ip }}</td>
<td>{{ node.shards }}</td>
<td>{{ node.termination_time }}</td>
<td>{{ node.terminated_by_nemesis }}</td>
</tr>
{% endif %}
{% endfor %}
</table>
</div>
{% endif %}
Expand Down
7 changes: 1 addition & 6 deletions sdcm/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -2750,12 +2750,7 @@ def get_email_data(self): # pylint: disable=no-self-use
return {}

def all_nodes_scylla_shards(self):
all_nodes_shards = defaultdict(list, {'live_nodes': [], 'dead_nodes': []})

# There are scale tests with a lot of nodes. It will be so big list of nodes to print it in the email
if len(self.db_cluster.dead_nodes_list) + len(self.db_cluster.nodes) > 20:
return all_nodes_shards

all_nodes_shards = defaultdict(list)
for node in self.db_cluster.nodes:
ipv6 = node.ipv6_ip_address if node.ip_address == node.ipv6_ip_address else ''
all_nodes_shards['live_nodes'].append({'name': node.name,
Expand Down

0 comments on commit 8b96732

Please sign in to comment.