Adjust memory to be approx. the same as by htop

pull/281/head
matlorr 1 month ago
parent 451dc262b2
commit 5b0715629a

@ -6,7 +6,7 @@ python=/usr/bin/python3
cpu_usage=relay/cpu_usage.py cpu_usage=relay/cpu_usage.py
# Execute python script # Execute python script
cpu=$($python $cpu_usage) cpu=$($python $cpu_usage)
# Calculate memory usage by computing used_memory/total_memory # Calculate memory usage by computing 1 - %free_memory
mem=$(free | sed '2q;d' | awk '{print $3/$2}') mem=$(free | sed '2q;d' | awk '{print 1 - ($4/$2)}')
printf "CPU, MEM\n%f, %f\n" $cpu $mem printf "CPU, MEM\n%f, %f\n" $cpu $mem

Loading…
Cancel
Save