Fix a billing bug that avemem is not correct.

This commit is contained in:
zhuyj17 2016-10-31 10:45:33 +08:00
parent feb02373fb
commit 78ef75b75f
1 changed files with 2 additions and 2 deletions

View File

@ -299,11 +299,11 @@ class Container_Collector(threading.Thread):
mem_use['val'] = mem_val mem_use['val'] = mem_val
mem_use['unit'] = mem_unit mem_use['unit'] = mem_unit
if(mem_unit == "MiB"): if(mem_unit == "MiB"):
mem_val = float(mem_val) * 1024
increment[container_name]['memincrement'] += float(mem_val) increment[container_name]['memincrement'] += float(mem_val)
mem_val = float(mem_val) * 1024
elif (mem_unit == "GiB"): elif (mem_unit == "GiB"):
mem_val = float(mem_val) * 1024 * 1024
increment[container_name]['memincrement'] += float(mem_val)*1024 increment[container_name]['memincrement'] += float(mem_val)*1024
mem_val = float(mem_val) * 1024 * 1024
mem_usedp = float(mem_val) / self.mem_quota[container_name] mem_usedp = float(mem_val) / self.mem_quota[container_name]
mem_use['usedp'] = mem_usedp mem_use['usedp'] = mem_usedp
workercinfo[container_name]['mem_use'] = mem_use workercinfo[container_name]['mem_use'] = mem_use