Use MemAvailable rather than MemFree (#914)

Fixes linux metrics reporting to report mem free before swap starts, instead of physical unused ram
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
This commit is contained in:
Ryan Blue
2023-09-23 10:36:38 -04:00
committed by GitHub
parent 7f283640c4
commit 9d0f1a34a8

View File

@@ -32,7 +32,7 @@ public class LinuxCmds extends CmdBase {
cpuUptimeCommand = "uptime -p | cut -c 4-";
// RAM
ramUsageCommand = "awk '/MemFree:/ {print int($2 / 1000);}' /proc/meminfo";
ramUsageCommand = "awk '/MemAvailable:/ {print int($2 / 1000);}' /proc/meminfo";
// Disk
diskUsageCommand = "df ./ --output=pcent | tail -n +2";