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

Handle zero mem available correctly in plot_metrics #391

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

alexander-veit
Copy link
Member

Plot metrics currently throws an error when the minimal available memory reported by CW is 0.

@@ -79,8 +79,8 @@ def get_metrics(self, nTimeChunks=1):
max_disk_space_used_GB_chunks.append(self.max_disk_space_used())
max_ebs_read_chunks.append(self.max_ebs_read())
self.max_mem_used_MB = self.choose_max(max_mem_used_MB_chunks)
self.min_mem_available_MB = self.choose_min(min_mem_available_MB_chunks)
if self.max_mem_used_MB:
self.min_mem_available_MB = self.get_min(min_mem_available_MB_chunks)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am replacing choose_min with get_min here since we want to keep 0.0 in the list. This assumes that we never get None or "" items from CW, which is probably save to assume?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problematic case occurred for min_mem_available_MB_chunks = [0.0]. This should now be handled correctly.

@alexander-veit alexander-veit merged commit 583e416 into master Sep 15, 2023
1 check passed
@alexander-veit alexander-veit deleted the handle_zero_mem branch September 15, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants