8000 Improve output from metrics summary by philipnrmn · Pull Request #1131 · dcos/dcos-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improve output from metrics summary #1131

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

Merged
merged 3 commits into from
Jan 19, 2018
Merged

Conversation

philipnrmn
Copy link
Contributor

Previously, as an outcome of dcos node metrics summary, the CLI reported the percentage of the disk that was available, eg 1GB (99%) for a 100GB disk.

This PR updates that calculation so we now see the used percentage, so in the above case the user would now see a disk entry of 1GB (1%).

Additionally, I expanded the output from the --json endpoint after noticing that it only reported the total system memory and disk usage.

We were calculating the percentage as free space / total space. We
should instead calculate it as used space / total space.
@philipnrmn philipnrmn requested a review from bamarni January 10, 2018 16:23
@@ -125,7 +127,7 @@ def _node_summary_data(datapoints):
disk_free = _get_datapoint_value(
datapoints, 'filesystem.capacity.used', {'path': '/'})
Copy link
Contributor

Choose a reason for hiding this comment

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

the variable is called disk_free while it seems to be disk_used (filesystem.capacity.used).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed :)

@@ -98,6 +98,8 @@ def _node_summary_json(datapoints):
summary_datapoints = [
_get_datapoint(datapoints, 'cpu.total'),
_get_datapoint(datapoints, 'memory.total'),
_get_datapoint(datapoints, 'memory.free'),
Copy link
Contributor

Choose a reason for hiding this comment

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

here for consistency, could we have memory.used? A few lines below there is filesystem.capacity.used. So that'd make datapoint pairs of used and total.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @bamarni I do agree that this would make more sense! Unfortunately memory.used isn't available in our stats - we only have memory.free.

@klueska
Copy link
Contributor
klueska commented Jan 19, 2018

@bamarni any 8000 other comments or can we start the CI on this one?

Copy link
Contributor
@bamarni bamarni left a comment

Choose a reason for hiding this comment

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

LGTM

@bamarni
Copy link
Contributor
bamarni commented Jan 19, 2018

run linux integration tests

@klueska klueska merged commit c5189ae into master Jan 19, 2018
@philipnrmn philipnrmn deleted the philipnrmn/metrics-details branch January 19, 2018 16:46
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.

3 participants
0