Display memory in bytes instead of MB for consistency
- Changed output to show bytes instead of MB - Updated header to show 'Minne (bytes)' - Better for comparing memory usage across all languages - Memory data already collected in bytes from ps command
This commit is contained in:
+3
-7
@@ -240,7 +240,7 @@ echo ""
|
||||
IFS=$'\n' sorted=($(printf '%s\n' "${results[@]}" | sort -n))
|
||||
unset IFS
|
||||
|
||||
echo "Språk Status Tid (ms) Minne (MB) CPU (%)"
|
||||
echo "Språk Status Tid (ms) Minne (bytes) CPU (%)"
|
||||
echo "================================================================"
|
||||
|
||||
for entry in "${sorted[@]}"; do
|
||||
@@ -251,17 +251,13 @@ for entry in "${sorted[@]}"; do
|
||||
peak_mem=$(echo "$entry" | awk '{print $5}')
|
||||
avg_cpu=$(echo "$entry" | awk '{print $6}')
|
||||
peak_cpu=$(echo "$entry" | awk '{print $7}')
|
||||
|
||||
# Convert to MB
|
||||
avg_mem_mb=$((avg_mem / 1024))
|
||||
peak_mem_mb=$((peak_mem / 1024))
|
||||
|
||||
printf "%-12s " "$name"
|
||||
|
||||
if [ "$status" = "SUCCESS" ]; then
|
||||
echo -e "${GREEN}$status${NC} $time_ms ms ${BLUE}${avg_mem_mb}MB avg / ${YELLOW}${peak_mem_mb}MB peak ${avg_cpu}% avg / ${peak_cpu}% peak${NC}"
|
||||
echo -e "${GREEN}$status${NC} $time_ms ms ${BLUE}${avg_mem} bytes avg / ${YELLOW}${peak_mem} bytes peak ${avg_cpu}% avg / ${peak_cpu}% peak${NC}"
|
||||
else
|
||||
echo -e "${RED}$status${NC} $time_ms ms ${BLUE}${avg_mem_mb}MB avg / ${YELLOW}${peak_mem_mb}MB peak ${avg_cpu}% avg / ${peak_cpu}% peak${NC}"
|
||||
echo -e "${RED}$status${NC} $time_ms ms ${BLUE}${avg_mem} bytes avg / ${YELLOW}${peak_mem} bytes peak ${avg_cpu}% avg / ${peak_cpu}% peak${NC}"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user