Report VPN pressure action in smoke

This commit is contained in:
2026-05-16 13:35:11 +03:00
parent 2cc4bba81d
commit ca923a4445
2 changed files with 39 additions and 3 deletions
@@ -51,6 +51,7 @@ type smokeReport struct {
FabricVPNPressureLevel string `json:"fabric_vpn_pressure_level"` FabricVPNPressureLevel string `json:"fabric_vpn_pressure_level"`
FabricVPNPressureScore int `json:"fabric_vpn_pressure_score"` FabricVPNPressureScore int `json:"fabric_vpn_pressure_score"`
FabricVPNPressureReason []string `json:"fabric_vpn_pressure_reasons"` FabricVPNPressureReason []string `json:"fabric_vpn_pressure_reasons"`
FabricVPNPressureAction string `json:"fabric_vpn_pressure_action"`
FabricVPNRouteRecovered bool `json:"fabric_vpn_route_recovered"` FabricVPNRouteRecovered bool `json:"fabric_vpn_route_recovered"`
FabricVPNRouteSwitches uint64 `json:"fabric_vpn_route_switch_count"` FabricVPNRouteSwitches uint64 `json:"fabric_vpn_route_switch_count"`
FabricVPNRecoveryMS int64 `json:"fabric_vpn_route_recovery_ms"` FabricVPNRecoveryMS int64 `json:"fabric_vpn_route_recovery_ms"`
@@ -160,7 +161,7 @@ func run(ctx context.Context) (smokeReport, error) {
if err != nil { if err != nil {
return smokeReport{}, fmt.Errorf("fabric vpn packet session smoke: %w", err) return smokeReport{}, fmt.Errorf("fabric vpn packet session smoke: %w", err)
} }
fabricVPNBulkPressure, fabricVPNBulkChannels, fabricVPNInteractiveChannels, fabricVPNBulkWindow, fabricVPNInteractiveWindow, fabricVPNPressureLevel, fabricVPNPressureScore, fabricVPNPressureReasons := smokeVPNFlowSchedulerBulkPressure() fabricVPNBulkPressure, fabricVPNBulkChannels, fabricVPNInteractiveChannels, fabricVPNBulkWindow, fabricVPNInteractiveWindow, fabricVPNPressureLevel, fabricVPNPressureScore, fabricVPNPressureReasons, fabricVPNPressureAction := smokeVPNFlowSchedulerBulkPressure()
fabricVPNRouteRecovered, fabricVPNRouteSwitches, fabricVPNRecoveryMS, fabricVPNRecoveryMaxMS, fabricVPNRecoveryAvgMS, fabricVPNRecoveryReason := smokeVPNFlowSchedulerRouteRecovery() fabricVPNRouteRecovered, fabricVPNRouteSwitches, fabricVPNRecoveryMS, fabricVPNRecoveryMaxMS, fabricVPNRecoveryAvgMS, fabricVPNRecoveryReason := smokeVPNFlowSchedulerRouteRecovery()
fabricQUICAccepted, fabricQUICEndpoint, fabricQUICPressure, err := smokeQUICFabricSession(ctx) fabricQUICAccepted, fabricQUICEndpoint, fabricQUICPressure, err := smokeQUICFabricSession(ctx)
if err != nil { if err != nil {
@@ -190,6 +191,7 @@ func run(ctx context.Context) (smokeReport, error) {
FabricVPNPressureLevel: fabricVPNPressureLevel, FabricVPNPressureLevel: fabricVPNPressureLevel,
FabricVPNPressureScore: fabricVPNPressureScore, FabricVPNPressureScore: fabricVPNPressureScore,
FabricVPNPressureReason: fabricVPNPressureReasons, FabricVPNPressureReason: fabricVPNPressureReasons,
FabricVPNPressureAction: fabricVPNPressureAction,
FabricVPNRouteRecovered: fabricVPNRouteRecovered, FabricVPNRouteRecovered: fabricVPNRouteRecovered,
FabricVPNRouteSwitches: fabricVPNRouteSwitches, FabricVPNRouteSwitches: fabricVPNRouteSwitches,
FabricVPNRecoveryMS: fabricVPNRecoveryMS, FabricVPNRecoveryMS: fabricVPNRecoveryMS,
@@ -209,7 +211,7 @@ func run(ctx context.Context) (smokeReport, error) {
}, nil }, nil
} }
func smokeVPNFlowSchedulerBulkPressure() (bool, int, int, int, int, string, int, []string) { func smokeVPNFlowSchedulerBulkPressure() (bool, int, int, int, int, string, int, []string, string) {
scheduler := vpnruntime.NewFabricFlowScheduler(32, 16) scheduler := vpnruntime.NewFabricFlowScheduler(32, 16)
bulkPacket := []byte("bulk") bulkPacket := []byte("bulk")
interactivePacket := []byte("interactive-rdp-like") interactivePacket := []byte("interactive-rdp-like")
@@ -233,7 +235,39 @@ func smokeVPNFlowSchedulerBulkPressure() (bool, int, int, int, int, string, int,
snapshot.RecommendedParallelWindows[vpnruntime.FabricTrafficClassInteractive], snapshot.RecommendedParallelWindows[vpnruntime.FabricTrafficClassInteractive],
snapshot.PressureLevel, snapshot.PressureLevel,
snapshot.PressureScore, snapshot.PressureScore,
snapshot.PressureReasons 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
} }
func smokeVPNFlowSchedulerRouteRecovery() (bool, uint64, int64, int64, int64, string) { func smokeVPNFlowSchedulerRouteRecovery() (bool, uint64, int64, int64, int64, string) {
@@ -475,6 +475,8 @@ recovery timing, reason counts, and recommended per-class windows.
The `flow_pressure` summary includes a `recommended_action` such as The `flow_pressure` summary includes a `recommended_action` such as
`observe`, `throttle_bulk`, `reduce_parallelism`, `prefer_faster_route`, `observe`, `throttle_bulk`, `reduce_parallelism`, `prefer_faster_route`,
`observe_recovery`, `rebuild_or_reroute`, or `shed_or_reroute`. `observe_recovery`, `rebuild_or_reroute`, or `shed_or_reroute`.
`mesh-live-smoke` reports the recommended action for its mixed bulk/interactive
load scenario.
Nodes advertise the `vpn_fabric_flow_pressure` capability when that heartbeat Nodes advertise the `vpn_fabric_flow_pressure` capability when that heartbeat
summary is available. summary is available.
When the VPN fabric ingress runtime has not been initialized yet, the heartbeat When the VPN fabric ingress runtime has not been initialized yet, the heartbeat