From 5b0715629a8f4d610e59f4fd05b6c0331a36739c Mon Sep 17 00:00:00 2001 From: matlorr Date: Fri, 10 Jan 2025 12:11:06 +0100 Subject: [PATCH] Adjust memory to be approx. the same as by htop --- relay/stats.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relay/stats.sh b/relay/stats.sh index 07e6972..f51d270 100755 --- a/relay/stats.sh +++ b/relay/stats.sh @@ -6,7 +6,7 @@ python=/usr/bin/python3 cpu_usage=relay/cpu_usage.py # Execute python script cpu=$($python $cpu_usage) -# Calculate memory usage by computing used_memory/total_memory -mem=$(free | sed '2q;d' | awk '{print $3/$2}') +# Calculate memory usage by computing 1 - %free_memory +mem=$(free | sed '2q;d' | awk '{print 1 - ($4/$2)}') printf "CPU, MEM\n%f, %f\n" $cpu $mem