Skip to content

Commit

Permalink
Fix memory usage reporting in GB
Browse files Browse the repository at this point in the history
  • Loading branch information
rjwills28 committed Oct 15, 2024
1 parent 93552bf commit f4d5b2d
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 < 10) {
if ($6 ~ /g/) {
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 < 1000) {
$1+0>0 {if ($6 ~ /g/) {
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 f4d5b2d

Please sign in to comment.