Created
January 21, 2022 02:47
-
-
Save sunfuze/71b521224f19fa797e81e281c29ddcfc to your computer and use it in GitHub Desktop.
show human readable cgroup memory stat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /sys/fs/cgroup/memory/memory.stat | awk 'BEGIN{suffixes_len=split("B KB MB GB",suffixes)} {n_suffix=1; while($2 > 1000 && | |
n_suffix < suffixes_len) {$2 /= 1024; n_suffix++;}; printf "%20s %7.2f %2s\n",$1,$2,suffixes[n_suffix]}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment