Skip to content

Commit f4d5b2d

Browse files
committed
Fix memory usage reporting in GB
1 parent 93552bf commit f4d5b2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

performance/cpu_monitor.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if [ $SAMPLE == true ]; then
5959
$1+0>0 {++COUNT
6060
TOTAL=TOTAL+$9
6161
if (COUNT % 10 == 0) {
62-
if ($6 < 10) {
62+
if ($6 ~ /g/) {
6363
printf "%s %s: Average CPU Usage: %d%%, Memory usage: %.2f GiB\n", \
6464
strftime("%Y-%m-%d"), time, TOTAL/COUNT, $6
6565
} else {
@@ -73,7 +73,7 @@ if [ $SAMPLE == true ]; then
7373
else
7474
top -b -d 2 -p $PID | awk -v pid="$PID" '
7575
/^top -/{time = $3}
76-
$1+0>0 {if ($6 < 1000) {
76+
$1+0>0 {if ($6 ~ /g/) {
7777
printf "%s %s: CPU Usage: %d%%, Memory usage: %.2f GiB\n", \
7878
strftime("%Y-%m-%d"), time, $9, $6
7979
} else {

0 commit comments

Comments
 (0)