Promote VPN pressure action to snapshot

This commit is contained in:
2026-05-16 13:39:09 +03:00
parent 0715d98c44
commit 5e4c0d596b
6 changed files with 46 additions and 80 deletions
@@ -236,38 +236,7 @@ func smokeVPNFlowSchedulerBulkPressure() (bool, int, int, int, int, string, int,
snapshot.PressureLevel,
snapshot.PressureScore,
snapshot.PressureReasons,
smokeVPNPressureAction(snapshot)
}
func smokeVPNPressureAction(snapshot vpnruntime.FabricFlowSchedulerSnapshot) string {
if containsSmokeString(snapshot.PressureReasons, "drops") || snapshot.QualityWindowDropCount > 0 {
return "shed_or_reroute"
}
if containsSmokeString(snapshot.PressureReasons, "route_failures") || snapshot.QualityWindowFailureCount > 0 || snapshot.FailingChannelCount > 0 {
return "rebuild_or_reroute"
}
if containsSmokeString(snapshot.PressureReasons, "route_recovery") || snapshot.RouteSwitchCount > 0 {
return "observe_recovery"
}
if containsSmokeString(snapshot.PressureReasons, "slow_channels") || snapshot.SlowChannelCount > 0 || snapshot.QualityWindowSlowCount > 0 {
return "prefer_faster_route"
}
if containsSmokeString(snapshot.PressureReasons, "bulk_pressure") || snapshot.BulkPressureActive {
return "throttle_bulk"
}
if snapshot.AdaptiveBackpressureActive || snapshot.BackpressureActive {
return "reduce_parallelism"
}
return "observe"
}
func containsSmokeString(values []string, needle string) bool {
for _, value := range values {
if value == needle {
return true
}
}
return false
snapshot.RecommendedAction
}
func smokeVPNFlowSchedulerRouteRecovery() (bool, uint64, int64, int64, int64, string) {