Promote VPN pressure action to snapshot
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user