def _get_docker_node_info(info):
"""Gets the node info specific to docker.
"""
cpucapacity = int(cpu_count() * 100)
memcapacity = (psutil.virtual_memory().total * 0.9) // _BYTES_IN_MB
# TODO: manage disk space a little better
if os.name == 'nt':
path = 'C:\\ProgramData\\docker'
else:
path = '/var/lib/docker'
diskfree = disk_usage(path).free // _BYTES_IN_MB
info.update({
'memory': '%dM' % memcapacity,
'disk': '%dM' % diskfree,
'cpu': '%d%%' % cpucapacity,
'up_since': up_since(),
})
return info
评论列表
文章目录