From 288ac7c6be67be29c3509b4391091253002fd760 Mon Sep 17 00:00:00 2001 From: Rebecca Williams Date: Thu, 28 Sep 2023 11:08:22 +0100 Subject: [PATCH] Further fix for cpu monitor --- performance/cpu_monitor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/performance/cpu_monitor.sh b/performance/cpu_monitor.sh index 4907c19..847777c 100755 --- a/performance/cpu_monitor.sh +++ b/performance/cpu_monitor.sh @@ -59,7 +59,7 @@ if [ $SAMPLE == true ]; then $1+0>0 {++COUNT TOTAL=TOTAL+$9 if (COUNT % 10 == 0) { - if ($6 lt 10) { + if ($6 < 10) { printf "%s %s: Average CPU Usage: %d%%, Memory usage: %.2f GiB\n", \ strftime("%Y-%m-%d"), time, TOTAL/COUNT, $6 } else { @@ -73,7 +73,7 @@ if [ $SAMPLE == true ]; then else top -b -d 2 -p $PID | awk -v pid="$PID" ' /^top -/{time = $3} - $1+0>0 {if ($6 lt 1000) { + $1+0>0 {if ($6 < 1000) { printf "%s %s: CPU Usage: %d%%, Memory usage: %.2f GiB\n", \ strftime("%Y-%m-%d"), time, $9, $6 } else {