[201911][procdockerstatsd] Fix bug in procdockerstatsd (#7073)
Fix incorrect variable name
This commit is contained in:
parent
bd07256bfd
commit
5f5644bb93
@ -76,13 +76,13 @@ class ProcDockerStats(daemon_base.DaemonBase):
|
||||
value = float(res.groups()[0])
|
||||
units = res.groups()[1]
|
||||
|
||||
if unit.lower() == UNITS_KB.lower():
|
||||
if units.lower() == UNITS_KB.lower():
|
||||
value *= 1000
|
||||
elif unit.lower() == UNITS_MB.lower():
|
||||
elif units.lower() == UNITS_MB.lower():
|
||||
value *= (1000 * 1000)
|
||||
elif unit.lower() == UNITS_MiB.lower():
|
||||
elif units.lower() == UNITS_MiB.lower():
|
||||
value *= (1024 * 1024)
|
||||
elif unit.lower() == UNITS_GiB.lower():
|
||||
elif units.lower() == UNITS_GiB.lower():
|
||||
value *= (1024 * 1024 * 1024)
|
||||
|
||||
return int(round(value))
|
||||
|
Loading…
Reference in New Issue
Block a user