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

[docker_daemon] Add metadata, tests and fix missing yaml option #2453

Merged
merged 2 commits into from
May 17, 2016

Conversation

hkaj
Copy link
Member

@hkaj hkaj commented Apr 28, 2016

Why this PR

This PR is a fix/improvement for #2405
It adds the same metrics for metadata and modify the existing name for consistency (this has not been released so no user will be impacted), setup testing and fix a missing option in docker_daemon.yaml.

@olivielpeau olivielpeau added this to the 5.8.0 milestone Apr 29, 2016
@hkaj hkaj force-pushed the haissam/disk-metrics-improvement branch from a0f2991 to 798c86f Compare May 2, 2016 12:25
return {}
if used > 0.0 and total > 0.0:
percs['docker.{0}.percent'.format(mtype)] = round(100 * float(used) / float(total), 2)
elif free > 0.0 and total > 0.0:
Copy link
Member

Choose a reason for hiding this comment

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

I think free could legitly be 0.0.

@hkaj hkaj force-pushed the haissam/disk-metrics-improvement branch from 798c86f to 3104b2d Compare May 3, 2016 14:32
@hkaj
Copy link
Member Author

hkaj commented May 3, 2016

Thanks for the feedback @truthbk, updated some things and added some testing.

used = stats.get('docker.{0}.used'.format(mtype))
total = stats.get('docker.{0}.total'.format(mtype))
free = stats.get('docker.{0}.free'.format(mtype))
if used and total and free and total < free + used:
Copy link

Choose a reason for hiding this comment

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

Should we add a small rounding tolerance factor here ?

@truthbk
Copy link
Member

truthbk commented May 9, 2016

I'd say that other than @remh consideration, it's looking good. With regards to his point, maybe it makes sense to use the ceiling of "total"? I'll let you decide on that one :)

@hkaj hkaj force-pushed the haissam/disk-metrics-improvement branch from 3104b2d to fd73dfd Compare May 12, 2016 14:15
@hkaj
Copy link
Member Author

hkaj commented May 12, 2016

@truthbk added a ceiling of total as a rounding margin.

@truthbk
Copy link
Member

truthbk commented May 13, 2016

👍 looks good... I was unable to run the tests locally. But I trust they're fine after the revamp. Feel free to squash and merge.

@hkaj hkaj merged commit de9d7da into master May 17, 2016
@hkaj hkaj deleted the haissam/disk-metrics-improvement branch May 17, 2016 09:34
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.

4 participants