ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
268 stars 34 forks source link

Memory usages in percentage wrong #41

Closed kireque closed 3 years ago

kireque commented 3 years ago

I have resource limits in place for my docker compose configuration. But these limits screw up the memory usage counter. I now have a memory usage of 527% for this node.

I think this is because memory usage is being calculated by the sum of docker stats? If limits are in place, these numbers are not totally reliable:

NAME           MEM USAGE / LIMIT   MEM % 
container 1    23.82MiB / 64MiB    37.22% 
container 2    192.2MiB / 512MiB   37.54% 
container 3    8.797MiB / 32MiB    27.49% 
container 4    392.4MiB / 640MiB   61.31%
container 5    4.008MiB / 32MiB    12.52% 
container 6    2.848MiB / 32MiB    8.90%  
container 7    198.5MiB / 256MiB   77.52%
container 8    53.19MiB / 128MiB   41.56%
container 9    23.9MiB / 1.5GiB    1.56%  
container 10   70.72MiB / 128MiB   55.25%
container 11   15.19MiB / 64MiB    23.74%
container 12   163.6MiB / 256MiB   63.90%
container 13   1.602MiB / 16MiB    10.01% 
container 14   62.05MiB / 128MiB   48.47%

Total:                             506.99%

Is there a way to fix this and get a reliable percentage?

ualex73 commented 3 years ago

The total memory percentage should be fix now, can you test the new code directly from GitHub?

kireque commented 3 years ago

I can confirm it's been fixed. Thanks for the quick support 👍

ualex73 commented 3 years ago

thanks, then we can close this one. I will release a new version, then it will be picked up by HACS.