fix: batch analyzer traffic display - show percentage not raw concurrent requests

- Change traffic indicator to display traffic PERCENTAGE (e.g., 99% of server)
- Remove display of raw peak concurrent requests (421) from traffic indicator
- Threshold-based severity: 50%+ CRITICAL, 25%+ HIGH, 10%+ MEDIUM, <10% LOW
- Shows traffic percentage consistently for both optimized and non-optimized domains
- Now displays like '⚠ CRITICAL TRAFFIC (99% of server)' instead of '⚠ CRITICAL TRAFFIC (421)'
This commit is contained in:
Developer
2026-04-20 18:45:35 -04:00
parent 0f4ea3ff9b
commit 333bc756ec
+11 -10
View File
@@ -280,17 +280,18 @@ for idx in "${sorted_indices[@]}"; do
continue continue
fi fi
# Determine traffic indicator # Determine traffic indicator based on traffic PERCENTAGE (not peak concurrent)
traffic_indicator="" traffic_indicator=""
if [[ "$peak" =~ ^[0-9]+$ ]]; then traffic_pct="${traffic_percentage_arr[$idx]:-0}"
if [ "$peak" -ge 20 ]; then if [[ "$traffic_pct" =~ ^[0-9]+$ ]]; then
traffic_indicator="${RED}⚠ CRITICAL TRAFFIC (${peak})${NC}" if [ "$traffic_pct" -ge 50 ]; then
elif [ "$peak" -ge 10 ]; then traffic_indicator="${RED}⚠ CRITICAL TRAFFIC${NC}"
traffic_indicator="${YELLOW}⚠ HIGH TRAFFIC (${peak})${NC}" elif [ "$traffic_pct" -ge 25 ]; then
elif [ "$peak" -ge 5 ]; then traffic_indicator="${YELLOW}⚠ HIGH TRAFFIC${NC}"
traffic_indicator="${CYAN}→ MEDIUM TRAFFIC (${peak})${NC}" elif [ "$traffic_pct" -ge 10 ]; then
traffic_indicator="${CYAN}→ MEDIUM TRAFFIC${NC}"
else else
traffic_indicator="${WHITE}○ LOW TRAFFIC (${peak})${NC}" traffic_indicator="${WHITE}○ LOW TRAFFIC${NC}"
fi fi
else else
traffic_indicator="${WHITE}○ TRAFFIC UNKNOWN${NC}" traffic_indicator="${WHITE}○ TRAFFIC UNKNOWN${NC}"
@@ -317,7 +318,7 @@ for idx in "${sorted_indices[@]}"; do
else else
cecho "${GREEN}[$idx]${NC} $domain" cecho "${GREEN}[$idx]${NC} $domain"
cecho " Owner: $owner" cecho " Owner: $owner"
cecho " Traffic: $traffic_indicator" cecho " Traffic: $traffic_indicator (${traffic_percentage_arr[$idx]}% of server)"
cecho "" cecho ""
cecho " ${BOLD}Pool Settings:${NC}" cecho " ${BOLD}Pool Settings:${NC}"
cecho " pm.max_children: $current" cecho " pm.max_children: $current"