Fix memory stats calc (#2518)

This commit is contained in:
Pascal Vizeli 2021-02-04 16:06:12 +01:00 committed by GitHub
parent 48f8553c75
commit ed8f2a85b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,9 @@ class DockerStats:
self._blk_write = 0
try:
self._memory_usage = stats["memory_stats"]["usage"]
self._memory_usage = (
stats["memory_stats"]["usage"] - stats["memory_stats"]["stats"]["cache"]
)
self._memory_limit = stats["memory_stats"]["limit"]
except KeyError:
self._memory_usage = 0