Skip to content

Commit

Permalink
Further fix for cpu monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
rjwills28 committed Sep 28, 2023
1 parent 594d739 commit 288ac7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions performance/cpu_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 288ac7c

Please sign in to comment.