Skip to content

Commit f5f37f6

Browse files
committed
outage: basic model
1 parent a75b053 commit f5f37f6

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

model/network_client_location_model.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,11 +2478,20 @@ func UpdateClientScores(ctx context.Context, ttl time.Duration, parallel int) (r
24782478
// the last filter represents the worst case the network will expose to users
24792479
minFilter := filter{
24802480
maxScore: 2 * scorePerTier,
2481-
minIndependentReliabilityWeights: map[int]float64{
2481+
}
2482+
if NormalNetworkConditions() {
2483+
minFilter.minIndependentReliabilityWeights = map[int]float64{
24822484
1: float64(0.99),
2483-
2: float64(0.8),
2485+
2: float64(0.7),
24842486
3: float64(0.6),
2485-
},
2487+
}
2488+
} else {
2489+
// some abormal conditions, loosen the stats as they reset
2490+
minFilter.minIndependentReliabilityWeights = map[int]float64{
2491+
1: float64(0.8),
2492+
2: float64(0.6),
2493+
3: float64(0.6),
2494+
}
24862495
}
24872496
minReliabilityWeightScale := 0.1
24882497
maxReliabilityWeightScale := 1.0

model/outage_model.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package model
2+
3+
// this signals if the network is operating in normal stable state (true),
4+
// or a degraded state (false). There can be many reasons for a degraded state not captured here.
5+
func NormalNetworkConditions() bool {
6+
// FIXME set to false if any service reported outage in the last N minutes
7+
return true
8+
}

0 commit comments

Comments
 (0)