Classify VPN scheduler pressure
This commit is contained in:
@@ -252,6 +252,8 @@ type FabricFlowSchedulerSnapshot struct {
|
||||
Dropped uint64 `json:"dropped"`
|
||||
HighWatermark int `json:"high_watermark"`
|
||||
BackpressureActive bool `json:"backpressure_active"`
|
||||
PressureLevel string `json:"pressure_level,omitempty"`
|
||||
PressureReasons []string `json:"pressure_reasons,omitempty"`
|
||||
InFlight int `json:"in_flight"`
|
||||
MaxInFlight int `json:"max_in_flight"`
|
||||
AdaptiveBackpressureActive bool `json:"adaptive_backpressure_active,omitempty"`
|
||||
@@ -860,9 +862,72 @@ func (s *FabricFlowScheduler) Snapshot() FabricFlowSchedulerSnapshot {
|
||||
snapshot.AdaptiveBackpressureReason = "bulk_window_reduced_to_protect_interactive"
|
||||
}
|
||||
}
|
||||
snapshot.PressureLevel, snapshot.PressureReasons = fabricFlowSchedulerPressure(snapshot)
|
||||
return snapshot
|
||||
}
|
||||
|
||||
func fabricFlowSchedulerPressure(snapshot FabricFlowSchedulerSnapshot) (string, []string) {
|
||||
level := "nominal"
|
||||
reasons := []string{}
|
||||
addReason := func(reason string) {
|
||||
reason = strings.TrimSpace(reason)
|
||||
if reason == "" {
|
||||
return
|
||||
}
|
||||
for _, existing := range reasons {
|
||||
if existing == reason {
|
||||
return
|
||||
}
|
||||
}
|
||||
reasons = append(reasons, reason)
|
||||
}
|
||||
escalate := func(next string) {
|
||||
if flowPressureRank(next) > flowPressureRank(level) {
|
||||
level = next
|
||||
}
|
||||
}
|
||||
if snapshot.Dropped > 0 || snapshot.QualityWindowDropCount > 0 {
|
||||
escalate("critical")
|
||||
addReason("drops")
|
||||
}
|
||||
if snapshot.FailingChannelCount > 0 || snapshot.QualityWindowFailureCount > 0 {
|
||||
escalate("critical")
|
||||
addReason("route_failures")
|
||||
}
|
||||
if snapshot.RouteRecoveredChannelCount > 0 || snapshot.RouteSwitchCount > 0 {
|
||||
escalate("warning")
|
||||
addReason("route_recovery")
|
||||
}
|
||||
if snapshot.SlowChannelCount > 0 || snapshot.QualityWindowSlowCount > 0 {
|
||||
escalate("warning")
|
||||
addReason("slow_channels")
|
||||
}
|
||||
if snapshot.BulkPressureActive {
|
||||
escalate("warning")
|
||||
addReason("bulk_pressure")
|
||||
}
|
||||
if snapshot.AdaptiveBackpressureActive {
|
||||
escalate("warning")
|
||||
addReason(snapshot.AdaptiveBackpressureReason)
|
||||
}
|
||||
if snapshot.BackpressureActive {
|
||||
escalate("warning")
|
||||
addReason("backpressure")
|
||||
}
|
||||
return level, reasons
|
||||
}
|
||||
|
||||
func flowPressureRank(level string) int {
|
||||
switch strings.TrimSpace(level) {
|
||||
case "critical":
|
||||
return 2
|
||||
case "warning":
|
||||
return 1
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func (s *FabricFlowScheduler) recommendedParallelSendWindowForTrafficClassLocked(trafficClass string, maxWindow int) int {
|
||||
if maxWindow <= 1 {
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user