Commit 1557e147 authored by Daniele Venzano's avatar Daniele Venzano

Fix problem with host labels

parent a9b02518
......@@ -73,8 +73,9 @@ class DockerStateSynchronizer(threading.Thread):
self.host_stats[host_config.name].container_count = info['Containers']
self.host_stats[host_config.name].cores_total = info['NCPU']
self.host_stats[host_config.name].memory_total = info['MemTotal']
self.host_stats[host_config.name].labels = host_config.labels
if info['Labels'] is not None:
self.host_stats[host_config.name].labels = host_config.labels + set(info['Labels'])
self.host_stats[host_config.name].labels += set(info['Labels'])
self.host_stats[host_config.name].memory_allocated = sum([cont['memory_soft_limit'] for cont in container_list if cont['memory_soft_limit'] != info['MemTotal']])
self.host_stats[host_config.name].cores_allocated = sum([cont['cpu_quota'] / cont['cpu_period'] for cont in container_list if cont['cpu_period'] != 0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment