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
-7
View File
@@ -1890,13 +1890,6 @@ func (p *ParticipantImpl) onDataMessage(kind livekit.DataPacket_Kind, data []byt
}
shouldForwardData = false
shouldForwardMetrics = true
// METRICS-TODO-QUESTIONS:
// 1. Should this record (and do processing/batching) metrics (i. e. publisher side) rather
// than forwarding and recording/processing/batching at every subscriber (in this case
// subscriber is defined as the other participants pushing this to edge client).
// 2. If the above is done, there could be two cadences, publisher side recording/processing/batching
// and pushing it to all subscribers on some cadence and subscribers have their own cadence of
// processing/batching and sending to edge clients.
p.metricTimestamper.Process(payload.Metrics)
case *livekit.DataPacket_RpcRequest:
if payload.RpcRequest == nil {
+9 -8
View File
@@ -452,13 +452,6 @@ func NewPCTransport(params TransportParams) (*PCTransport, error) {
lastNegotiate: time.Now(),
}
if params.IsSendSide {
t.streamAllocator = streamallocator.NewStreamAllocator(streamallocator.StreamAllocatorParams{
Config: params.CongestionControlConfig.StreamAllocator,
Logger: params.Logger.WithComponent(utils.ComponentCongestionControl),
}, params.CongestionControlConfig.Enabled, params.CongestionControlConfig.AllowPause)
t.streamAllocator.OnStreamStateChange(params.Handler.OnStreamStateChange)
t.streamAllocator.Start()
if params.CongestionControlConfig.UseSendSideBWE || params.UseSendSideBWE {
params.Logger.Infow("using send side BWE")
t.bwe = sendsidebwe.NewSendSideBWE(sendsidebwe.SendSideBWEParams{
@@ -473,7 +466,15 @@ func NewPCTransport(params TransportParams) (*PCTransport, error) {
})
t.pacer = pacer.NewPassThrough(params.Logger, nil)
}
t.streamAllocator.SetBWE(t.bwe)
t.streamAllocator = streamallocator.NewStreamAllocator(streamallocator.StreamAllocatorParams{
Config: params.CongestionControlConfig.StreamAllocator,
BWE: t.bwe,
Pacer: t.pacer,
Logger: params.Logger.WithComponent(utils.ComponentCongestionControl),
}, params.CongestionControlConfig.Enabled, params.CongestionControlConfig.AllowPause)
t.streamAllocator.OnStreamStateChange(params.Handler.OnStreamStateChange)
t.streamAllocator.Start()
}
if err := t.createPeerConnection(); err != nil {