BWE minor tweaks (#3254)
- Clear probe id in downtracks when aborting probe - a bit of clean up
This commit is contained in:
@@ -140,8 +140,12 @@ func (p *probeController) ProbeClusterDone(pci ccutils.ProbeClusterInfo) {
|
|||||||
p.setState(probeControllerStateHangover)
|
p.setState(probeControllerStateHangover)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *probeController) ProbeClusterInfo() ccutils.ProbeClusterInfo {
|
func (p *probeController) ProbeClusterIsGoalReached(estimate int64) bool {
|
||||||
return p.pci
|
if p.pci.Id == ccutils.ProbeClusterIdInvalid {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return estimate > int64(p.pci.Goal.DesiredBps)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *probeController) MaybeFinalizeProbe() (ccutils.ProbeClusterInfo, bool) {
|
func (p *probeController) MaybeFinalizeProbe() (ccutils.ProbeClusterInfo, bool) {
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ func (r *RemoteBWE) ProbeClusterIsGoalReached() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return r.channelObserver.GetHighestEstimate() > int64(r.probeController.ProbeClusterInfo().Goal.DesiredBps)
|
return r.probeController.ProbeClusterIsGoalReached(r.channelObserver.GetHighestEstimate())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RemoteBWE) ProbeClusterFinalize() (ccutils.ProbeSignal, int64, bool) {
|
func (r *RemoteBWE) ProbeClusterFinalize() (ccutils.ProbeSignal, int64, bool) {
|
||||||
|
|||||||
@@ -678,6 +678,7 @@ func (s *StreamAllocator) handleSignalPeriodicPing(Event) {
|
|||||||
// reset BWE if that persists for a while
|
// reset BWE if that persists for a while
|
||||||
if s.state == streamAllocatorStateDeficient && s.params.Pacer.TimeSinceLastSentPacket() > s.params.Config.PausedMinWait {
|
if s.state == streamAllocatorStateDeficient && s.params.Pacer.TimeSinceLastSentPacket() > s.params.Config.PausedMinWait {
|
||||||
s.params.Logger.Infow("stream allocator: resetting bwe to enable probing")
|
s.params.Logger.Infow("stream allocator: resetting bwe to enable probing")
|
||||||
|
s.maybeStopProbe()
|
||||||
s.params.BWE.Reset()
|
s.params.BWE.Reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1041,6 +1042,11 @@ func (s *StreamAllocator) maybeStopProbe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pci := s.params.Pacer.EndProbeCluster(s.activeProbeClusterId)
|
pci := s.params.Pacer.EndProbeCluster(s.activeProbeClusterId)
|
||||||
|
|
||||||
|
for _, t := range s.getTracks() {
|
||||||
|
t.DownTrack().SwapProbeClusterId(pci.Id, ccutils.ProbeClusterIdInvalid)
|
||||||
|
}
|
||||||
|
|
||||||
s.params.BWE.ProbeClusterDone(pci)
|
s.params.BWE.ProbeClusterDone(pci)
|
||||||
s.prober.Reset(pci)
|
s.prober.Reset(pci)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user