Move probe observer to pacer (#3214)

* Probe ID pass

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* clean up

* typo

* populate desired bytes

* correct num probes calculation

* debug log

* remove unused constant

* log channel observer

* debug

* clear isInProbe flag on end

* clear probe flag on reset

* re-arrange
This commit is contained in:
Raja Subramanian
2024-11-29 09:19:48 +05:30
committed by GitHub
parent 3372e6e285
commit 427ed23478
10 changed files with 442 additions and 405 deletions
+4 -6
View File
@@ -24,10 +24,6 @@ import (
"github.com/livekit/protocol/utils/mono"
)
const (
ChannelCapacityInfinity = 100 * 1000 * 1000 // 100 Mbps
)
// ---------------------------------------------------------------------------
type RemoteBWEConfig struct {
@@ -110,6 +106,7 @@ func (r *RemoteBWE) Reset() {
defer r.lock.Unlock()
r.channelObserver = r.newChannelObserverNonProbe()
r.isInProbe = false
}
func (r *RemoteBWE) Stop() {
@@ -205,7 +202,7 @@ func (r *RemoteBWE) estimateAvailableChannelCapacity(reason channelCongestionRea
"channel", r.channelObserver,
)
if estimateToCommit > commitThreshold {
ulgr.Debugw("remote bwe: channel congestion detected, skipping above commit threshold channel capacity update")
ulgr.Debugw("remote bwe: channel congestion detected, skipping above commit threshold channel capacity update")
return false
}
@@ -298,7 +295,7 @@ func (r *RemoteBWE) ProbingEnd(isNotFailing bool, isGoalReached bool) {
// the send side is in full control of bandwidth estimation.
//
r.params.Logger.Debugw(
"probe done",
"remote bwe: probe done",
"isNotFailing", isNotFailing,
"isGoalReached", isGoalReached,
"committedEstimate", r.committedChannelCapacity,
@@ -306,6 +303,7 @@ func (r *RemoteBWE) ProbingEnd(isNotFailing bool, isGoalReached bool) {
"channel", r.channelObserver,
)
r.channelObserver = r.newChannelObserverNonProbe()
r.isInProbe = false
if !isNotFailing {
return
}