We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93552bf commit f4d5b2dCopy full SHA for f4d5b2d
performance/cpu_monitor.sh
@@ -59,7 +59,7 @@ if [ $SAMPLE == true ]; then
59
$1+0>0 {++COUNT
60
TOTAL=TOTAL+$9
61
if (COUNT % 10 == 0) {
62
- if ($6 < 10) {
+ if ($6 ~ /g/) {
63
printf "%s %s: Average CPU Usage: %d%%, Memory usage: %.2f GiB\n", \
64
strftime("%Y-%m-%d"), time, TOTAL/COUNT, $6
65
} else {
@@ -73,7 +73,7 @@ if [ $SAMPLE == true ]; then
73
else
74
top -b -d 2 -p $PID | awk -v pid="$PID" '
75
/^top -/{time = $3}
76
- $1+0>0 {if ($6 < 1000) {
+ $1+0>0 {if ($6 ~ /g/) {
77
printf "%s %s: CPU Usage: %d%%, Memory usage: %.2f GiB\n", \
78
strftime("%Y-%m-%d"), time, $9, $6
79
0 commit comments