Skip to content

Instantly share code, notes, and snippets.

View erickweil's full-sized avatar

Erick Leonardo Weil erickweil

  • Brazil
View GitHub Profile
#!/usr/bin/python3
# https://github.com/nestybox/sysbox/issues/714
# Memory and CPU usage of Sysbox containers isn't displayed correctly in docker stats,
# The bash code lists the memory usage in bytes, directly from the virtual file system
#CONTAINERS=$(docker ps -q --no-trunc)
#for c in $CONTAINERS; do
# cat /sys/fs/cgroup/system.slice/docker-$c.scope/memory.current
#done
# This python code just turns the bash snippet above into something easier to read