Refine CPU usage calculation in performance monitoring script by truncating decimal values before summation.

This commit is contained in:
2025-09-27 05:56:31 -05:00
parent 0ac2a8d200
commit 7d7a022736

View File

@@ -31,7 +31,8 @@ while [ $SECONDS -lt $END_TIME ] && kill -0 $PID 2>/dev/null; do
SAMPLES=$((SAMPLES + 1))
TOTAL_RSS=$((TOTAL_RSS + RSS))
TOTAL_VSZ=$((TOTAL_VSZ + VSZ))
TOTAL_CPU=$((TOTAL_CPU + CPU))
CPU_INT=$(echo $CPU | cut -d. -f1)
TOTAL_CPU=$((TOTAL_CPU + CPU_INT))
if [ $RSS -gt $MAX_RSS ]; then
MAX_RSS=$RSS