-
Notifications
You must be signed in to change notification settings - Fork 241
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
Print metastatus free resources alongside total resource capacity #315
Conversation
resource_dict[slave_attribute_name].update(filter_mesos_state_metrics(slave['resources'])) | ||
filtered_resources = filter_mesos_state_metrics(slave['resources']) | ||
resource_free_dict[slave_attribute_name].update(filtered_resources) | ||
resource_availability_dict[slave_attribute_name] = filtered_resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work -- you're not summing the total resources for each attribute type, just overwriting the resource_availability_dict
for every host with that attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example of this failing on srv1-uswest1adevc:
Habitat CPU (free/total) RAM (free/total) Disk (free/total)
uswest1cdevc 160.64/13.00 520420.00/28708.00 3343410.00/290315.00
uswest1adevc 180.49/15.00 644467.00/62419.00 3357741.00/280244.00
This code block already gets the total resources an attribute has before subtracting what each slave is using so why not let it complete and make a copy with copy.deepcopy()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, dumb mistake on my part. I've fixed as per your recommendation and added a test to catch the bug.
Cool. This is mostly printing and stuff, so I guess there isn't too much need for more tests? Shipit. |
LGTM. Ship it. |
shipit 🚢 |
Print metastatus free resources alongside total resource capacity
Add more detail to the output of paasta_metastatus. When used with the current Mesos test data, output at the moment looks like:
With this change it looks like: