рабочий вариант, но скороть 10 МБит
This commit is contained in:
@@ -1621,7 +1621,7 @@ func verdict(report loadtestReport) (string, []string) {
|
||||
reasons = append(reasons, targetAckVerdictReasons(report)...)
|
||||
reasons = append(reasons, routePressureDistributionVerdictReasons(report)...)
|
||||
reasons = append(reasons, targetEndpointPolicyVerdictReasons(report)...)
|
||||
reasons = append(reasons, legacyRouteModeVerdictReasons(report)...)
|
||||
reasons = append(reasons, disallowedRouteModeVerdictReasons(report)...)
|
||||
reasons = append(reasons, routeModeCoverageVerdictReasons(report)...)
|
||||
if len(reasons) > 0 {
|
||||
return "fail", reasons
|
||||
@@ -1846,25 +1846,22 @@ func targetEndpointPolicyVerdictReasons(report loadtestReport) []string {
|
||||
return []string{fmt.Sprintf("non_quic_targets=%s", strings.Join(invalid, ","))}
|
||||
}
|
||||
|
||||
func legacyRouteModeVerdictReasons(report loadtestReport) []string {
|
||||
func disallowedRouteModeVerdictReasons(report loadtestReport) []string {
|
||||
if len(report.TargetStats) == 0 {
|
||||
return nil
|
||||
}
|
||||
legacyModes := map[string]struct{}{
|
||||
"relay": {},
|
||||
"outbound_reverse": {},
|
||||
"websocket": {},
|
||||
"ws": {},
|
||||
"wss": {},
|
||||
"direct_http": {},
|
||||
"direct_https": {},
|
||||
"direct_tcp_tls": {},
|
||||
supportedModes := map[string]struct{}{
|
||||
string(mesh.FabricRouteDirect): {},
|
||||
string(mesh.FabricRouteLAN): {},
|
||||
string(mesh.FabricRouteICE): {},
|
||||
string(mesh.FabricRouteReverse): {},
|
||||
string(mesh.FabricRouteRelay): {},
|
||||
}
|
||||
found := map[string]int{}
|
||||
for _, stats := range report.TargetStats {
|
||||
for mode, count := range stats.RouteModes {
|
||||
mode = strings.ToLower(strings.TrimSpace(mode))
|
||||
if _, legacy := legacyModes[mode]; legacy && count > 0 {
|
||||
if _, supported := supportedModes[mode]; !supported && count > 0 {
|
||||
found[mode] += count
|
||||
}
|
||||
}
|
||||
@@ -1877,7 +1874,7 @@ func legacyRouteModeVerdictReasons(report loadtestReport) []string {
|
||||
modes = append(modes, fmt.Sprintf("%s:%d", mode, count))
|
||||
}
|
||||
sort.Strings(modes)
|
||||
return []string{fmt.Sprintf("legacy_route_modes_observed=%s", strings.Join(modes, ","))}
|
||||
return []string{fmt.Sprintf("compat_route_modes_observed=%s", strings.Join(modes, ","))}
|
||||
}
|
||||
|
||||
func routeModeCoverageVerdictReasons(report loadtestReport) []string {
|
||||
|
||||
Reference in New Issue
Block a user