Align test analytics output (#14115)

This commit is contained in:
Murchik
2026-05-30 16:50:29 +03:00
committed by GitHub
parent ef19845a80
commit 7e9b42a00b

View File

@@ -838,13 +838,18 @@ try {
Write-Host "" Write-Host ""
Write-Host "=== ANALYTICS ===" -ForegroundColor Cyan Write-Host "=== ANALYTICS ===" -ForegroundColor Cyan
$maxConfigLen = ($analytics.Keys | ForEach-Object { $_.Length } | Measure-Object -Maximum).Maximum
foreach ($config in $analytics.Keys) { foreach ($config in $analytics.Keys) {
$a = $analytics[$config] $a = $analytics[$config]
$configPadded = $config.PadRight($maxConfigLen)
if ($a.ContainsKey('PingOK')) { if ($a.ContainsKey('PingOK')) {
Write-Host "$config : HTTP OK: $($a.OK), ERR: $($a.ERROR), UNSUP: $($a.UNSUP), Ping OK: $($a.PingOK), Fail: $($a.PingFail)" -ForegroundColor Yellow $line = "{0} : HTTP OK: {1,3}, ERR: {2,3}, UNSUP: {3,3}, Ping OK: {4,3}, Fail: {5,3}" -f `
$configPadded, $a.OK, $a.ERROR, $a.UNSUP, $a.PingOK, $a.PingFail
} else { } else {
Write-Host "$config : OK: $($a.OK), FAIL: $($a.FAIL), UNSUP: $($a.UNSUPPORTED), BLOCKED: $($a.LIKELY_BLOCKED)" -ForegroundColor Yellow $line = "{0} : OK: {1,3}, FAIL: {2,3}, UNSUP: {3,3}, BLOCKED: {4,3}" -f `
$configPadded, $a.OK, $a.FAIL, $a.UNSUPPORTED, $a.LIKELY_BLOCKED
} }
Write-Host $line -ForegroundColor Yellow
} }
# Determine best strategy # Determine best strategy
@@ -916,13 +921,18 @@ try {
# Add analytics # Add analytics
Add-Content $resultFile "=== ANALYTICS ===" Add-Content $resultFile "=== ANALYTICS ==="
$maxConfigLen = ($analytics.Keys | ForEach-Object { $_.Length } | Measure-Object -Maximum).Maximum
foreach ($config in $analytics.Keys) { foreach ($config in $analytics.Keys) {
$a = $analytics[$config] $a = $analytics[$config]
$configPadded = $config.PadRight($maxConfigLen)
if ($a.ContainsKey('PingOK')) { if ($a.ContainsKey('PingOK')) {
Add-Content $resultFile "$config : HTTP OK: $($a.OK), ERR: $($a.ERROR), UNSUP: $($a.UNSUP), Ping OK: $($a.PingOK), Fail: $($a.PingFail)" $line = "{0} : HTTP OK: {1,3}, ERR: {2,3}, UNSUP: {3,3}, Ping OK: {4,3}, Fail: {5,3}" -f `
$configPadded, $a.OK, $a.ERROR, $a.UNSUP, $a.PingOK, $a.PingFail
} else { } else {
Add-Content $resultFile "$config : OK: $($a.OK), FAIL: $($a.FAIL), UNSUP: $($a.UNSUPPORTED), BLOCKED: $($a.LIKELY_BLOCKED)" $line = "{0} : OK: {1,3}, FAIL: {2,3}, UNSUP: {3,3}, BLOCKED: {4,3}" -f `
$configPadded, $a.OK, $a.FAIL, $a.UNSUPPORTED, $a.LIKELY_BLOCKED
} }
Add-Content $resultFile $line
} }
Add-Content $resultFile "Best strategy: $bestConfig" Add-Content $resultFile "Best strategy: $bestConfig"