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:
@@ -280,17 +280,18 @@ for idx in "${sorted_indices[@]}"; do
|
||||
continue
|
||||
fi
|
||||
|
||||
# Determine traffic indicator
|
||||
# Determine traffic indicator based on traffic PERCENTAGE (not peak concurrent)
|
||||
traffic_indicator=""
|
||||
if [[ "$peak" =~ ^[0-9]+$ ]]; then
|
||||
if [ "$peak" -ge 20 ]; then
|
||||
traffic_indicator="${RED}⚠ CRITICAL TRAFFIC (${peak})${NC}"
|
||||
elif [ "$peak" -ge 10 ]; then
|
||||
traffic_indicator="${YELLOW}⚠ HIGH TRAFFIC (${peak})${NC}"
|
||||
elif [ "$peak" -ge 5 ]; then
|
||||
traffic_indicator="${CYAN}→ MEDIUM TRAFFIC (${peak})${NC}"
|
||||
traffic_pct="${traffic_percentage_arr[$idx]:-0}"
|
||||
if [[ "$traffic_pct" =~ ^[0-9]+$ ]]; then
|
||||
if [ "$traffic_pct" -ge 50 ]; then
|
||||
traffic_indicator="${RED}⚠ CRITICAL TRAFFIC${NC}"
|
||||
elif [ "$traffic_pct" -ge 25 ]; then
|
||||
traffic_indicator="${YELLOW}⚠ HIGH TRAFFIC${NC}"
|
||||
elif [ "$traffic_pct" -ge 10 ]; then
|
||||
traffic_indicator="${CYAN}→ MEDIUM TRAFFIC${NC}"
|
||||
else
|
||||
traffic_indicator="${WHITE}○ LOW TRAFFIC (${peak})${NC}"
|
||||
traffic_indicator="${WHITE}○ LOW TRAFFIC${NC}"
|
||||
fi
|
||||
else
|
||||
traffic_indicator="${WHITE}○ TRAFFIC UNKNOWN${NC}"
|
||||
@@ -317,7 +318,7 @@ for idx in "${sorted_indices[@]}"; do
|
||||
else
|
||||
cecho "${GREEN}[$idx]${NC} $domain"
|
||||
cecho " Owner: $owner"
|
||||
cecho " Traffic: $traffic_indicator"
|
||||
cecho " Traffic: $traffic_indicator (${traffic_percentage_arr[$idx]}% of server)"
|
||||
cecho ""
|
||||
cecho " ${BOLD}Pool Settings:${NC}"
|
||||
cecho " pm.max_children: $current"
|
||||
|
||||
Reference in New Issue
Block a user