Add method to check for probe goal reached (#3253)
* Check for early probe end * use old packets for probing * fmt
This commit is contained in:
@@ -89,6 +89,7 @@ type BWE interface {
|
||||
ProbeDuration() time.Duration
|
||||
ProbeClusterStarting(pci ccutils.ProbeClusterInfo)
|
||||
ProbeClusterDone(pci ccutils.ProbeClusterInfo)
|
||||
ProbeClusterIsGoalReached() bool
|
||||
ProbeClusterFinalize() (ccutils.ProbeSignal, int64, bool)
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,10 @@ func (n *NullBWE) ProbeClusterStarting(_pci ccutils.ProbeClusterInfo) {}
|
||||
|
||||
func (n *NullBWE) ProbeClusterDone(_pci ccutils.ProbeClusterInfo) {}
|
||||
|
||||
func (n *NullBWE) ProbeClusterIsGoalReached() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (n *NullBWE) ProbeClusterFinalize() (ccutils.ProbeSignal, int64, bool) {
|
||||
return ccutils.ProbeSignalInconclusive, 0, false
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ var (
|
||||
ProbeRegulator: ccutils.DefaultProbeRegulatorConfig,
|
||||
|
||||
SettleWaitNumRTT: 5,
|
||||
SettleWaitMin: 500 * time.Millisecond,
|
||||
SettleWaitMax: 10 * time.Second,
|
||||
SettleWaitMin: 250 * time.Millisecond,
|
||||
SettleWaitMax: 5 * time.Second,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -140,6 +140,10 @@ func (p *probeController) ProbeClusterDone(pci ccutils.ProbeClusterInfo) {
|
||||
p.setState(probeControllerStateHangover)
|
||||
}
|
||||
|
||||
func (p *probeController) ProbeClusterInfo() ccutils.ProbeClusterInfo {
|
||||
return p.pci
|
||||
}
|
||||
|
||||
func (p *probeController) MaybeFinalizeProbe() (ccutils.ProbeClusterInfo, bool) {
|
||||
if p.state != probeControllerStateHangover {
|
||||
return ccutils.ProbeClusterInfoInvalid, false
|
||||
|
||||
@@ -158,11 +158,6 @@ func (r *RemoteBWE) congestionDetectionStateMachine() (bool, bwe.CongestionState
|
||||
newState := r.congestionState
|
||||
update := false
|
||||
trend, reason := r.channelObserver.GetTrend()
|
||||
if trend == channelTrendCongesting && r.congestionState == bwe.CongestionStateNone {
|
||||
r.params.Logger.Debugw("remote bwe, channel congesting", "channel", r.channelObserver)
|
||||
} else if trend == channelTrendClearing && r.congestionState != bwe.CongestionStateNone {
|
||||
r.params.Logger.Debugw("remote bwe, channel congestion relieving", "channel", r.channelObserver)
|
||||
}
|
||||
|
||||
switch r.congestionState {
|
||||
case bwe.CongestionStateNone:
|
||||
@@ -285,6 +280,19 @@ func (r *RemoteBWE) ProbeClusterDone(pci ccutils.ProbeClusterInfo) {
|
||||
r.probeController.ProbeClusterDone(pci)
|
||||
}
|
||||
|
||||
func (r *RemoteBWE) ProbeClusterIsGoalReached() bool {
|
||||
r.lock.Lock()
|
||||
defer r.lock.Unlock()
|
||||
|
||||
if !r.probeController.IsInProbe() ||
|
||||
r.congestionState != bwe.CongestionStateNone ||
|
||||
!r.channelObserver.HasEnoughEstimateSamples() {
|
||||
return false
|
||||
}
|
||||
|
||||
return r.channelObserver.GetHighestEstimate() > int64(r.probeController.ProbeClusterInfo().Goal.DesiredBps)
|
||||
}
|
||||
|
||||
func (r *RemoteBWE) ProbeClusterFinalize() (ccutils.ProbeSignal, int64, bool) {
|
||||
r.lock.Lock()
|
||||
defer r.lock.Unlock()
|
||||
|
||||
@@ -42,8 +42,8 @@ var (
|
||||
},
|
||||
|
||||
SettleWaitNumRTT: 5,
|
||||
SettleWaitMin: 500 * time.Millisecond,
|
||||
SettleWaitMax: 10 * time.Second,
|
||||
SettleWaitMin: 250 * time.Millisecond,
|
||||
SettleWaitMax: 5 * time.Second,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user