Score VPN scheduler pressure
This commit is contained in:
@@ -253,6 +253,7 @@ type FabricFlowSchedulerSnapshot struct {
|
||||
HighWatermark int `json:"high_watermark"`
|
||||
BackpressureActive bool `json:"backpressure_active"`
|
||||
PressureLevel string `json:"pressure_level,omitempty"`
|
||||
PressureScore int `json:"pressure_score,omitempty"`
|
||||
PressureReasons []string `json:"pressure_reasons,omitempty"`
|
||||
InFlight int `json:"in_flight"`
|
||||
MaxInFlight int `json:"max_in_flight"`
|
||||
@@ -862,12 +863,13 @@ func (s *FabricFlowScheduler) Snapshot() FabricFlowSchedulerSnapshot {
|
||||
snapshot.AdaptiveBackpressureReason = "bulk_window_reduced_to_protect_interactive"
|
||||
}
|
||||
}
|
||||
snapshot.PressureLevel, snapshot.PressureReasons = fabricFlowSchedulerPressure(snapshot)
|
||||
snapshot.PressureLevel, snapshot.PressureScore, snapshot.PressureReasons = fabricFlowSchedulerPressure(snapshot)
|
||||
return snapshot
|
||||
}
|
||||
|
||||
func fabricFlowSchedulerPressure(snapshot FabricFlowSchedulerSnapshot) (string, []string) {
|
||||
func fabricFlowSchedulerPressure(snapshot FabricFlowSchedulerSnapshot) (string, int, []string) {
|
||||
level := "nominal"
|
||||
score := 0
|
||||
reasons := []string{}
|
||||
addReason := func(reason string) {
|
||||
reason = strings.TrimSpace(reason)
|
||||
@@ -888,33 +890,43 @@ func fabricFlowSchedulerPressure(snapshot FabricFlowSchedulerSnapshot) (string,
|
||||
}
|
||||
if snapshot.Dropped > 0 || snapshot.QualityWindowDropCount > 0 {
|
||||
escalate("critical")
|
||||
score += boundedFabricPressureScore(int(snapshot.Dropped)+snapshot.QualityWindowDropCount*10, 20, 40)
|
||||
addReason("drops")
|
||||
}
|
||||
if snapshot.FailingChannelCount > 0 || snapshot.QualityWindowFailureCount > 0 {
|
||||
escalate("critical")
|
||||
score += boundedFabricPressureScore((snapshot.FailingChannelCount+snapshot.QualityWindowFailureCount)*10, 20, 40)
|
||||
addReason("route_failures")
|
||||
}
|
||||
if snapshot.RouteRecoveredChannelCount > 0 || snapshot.RouteSwitchCount > 0 {
|
||||
escalate("warning")
|
||||
score += boundedFabricPressureScore(snapshot.RouteRecoveredChannelCount*8+int(snapshot.RouteSwitchCount)*4, 8, 24)
|
||||
addReason("route_recovery")
|
||||
}
|
||||
if snapshot.SlowChannelCount > 0 || snapshot.QualityWindowSlowCount > 0 {
|
||||
escalate("warning")
|
||||
score += boundedFabricPressureScore((snapshot.SlowChannelCount+snapshot.QualityWindowSlowCount)*6, 6, 24)
|
||||
addReason("slow_channels")
|
||||
}
|
||||
if snapshot.BulkPressureActive {
|
||||
escalate("warning")
|
||||
score += 15
|
||||
addReason("bulk_pressure")
|
||||
}
|
||||
if snapshot.AdaptiveBackpressureActive {
|
||||
escalate("warning")
|
||||
score += 10
|
||||
addReason(snapshot.AdaptiveBackpressureReason)
|
||||
}
|
||||
if snapshot.BackpressureActive {
|
||||
escalate("warning")
|
||||
score += 10
|
||||
addReason("backpressure")
|
||||
}
|
||||
return level, reasons
|
||||
if score > 100 {
|
||||
score = 100
|
||||
}
|
||||
return level, score, reasons
|
||||
}
|
||||
|
||||
func flowPressureRank(level string) int {
|
||||
@@ -928,6 +940,16 @@ func flowPressureRank(level string) int {
|
||||
}
|
||||
}
|
||||
|
||||
func boundedFabricPressureScore(value, minValue, maxValue int) int {
|
||||
if value < minValue {
|
||||
return minValue
|
||||
}
|
||||
if value > maxValue {
|
||||
return maxValue
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
func (s *FabricFlowScheduler) recommendedParallelSendWindowForTrafficClassLocked(trafficClass string, maxWindow int) int {
|
||||
if maxWindow <= 1 {
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user