mirror of
https://github.com/livekit/livekit.git
synced 2026-05-13 03:35:20 +00:00
Declare congestion none only if both methods are in DQR. (#3372)
* Declare congestion none only if both emthods are in DQR. * do not change congestion reason unless queuing region changes
This commit is contained in:
@@ -250,8 +250,10 @@ func (q *qdMeasurement) ProcessPacketGroup(pg *packetGroup, groupIdx int) {
|
||||
}
|
||||
|
||||
default:
|
||||
// broken continuity, seal
|
||||
q.isSealed = true
|
||||
if q.numDQRGroups > 0 || q.numJQRGroups > 0 {
|
||||
// broken continuity, seal
|
||||
q.isSealed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,15 +877,18 @@ func (c *congestionDetector) updateCongestionSignal(
|
||||
}
|
||||
}
|
||||
|
||||
c.congestionReason = congestionReasonNone
|
||||
c.queuingRegion = c.qdMeasurement.QueuingRegion()
|
||||
if c.queuingRegion == queuingRegionJQR {
|
||||
qdQueuingRegion := c.qdMeasurement.QueuingRegion()
|
||||
lossQueuingRegion := c.lossMeasurement.QueuingRegion()
|
||||
switch {
|
||||
case qdQueuingRegion == queuingRegionJQR:
|
||||
c.queuingRegion = queuingRegionJQR
|
||||
c.congestionReason = congestionReasonQueuingDelay
|
||||
} else {
|
||||
c.queuingRegion = c.lossMeasurement.QueuingRegion()
|
||||
if c.queuingRegion == queuingRegionJQR {
|
||||
c.congestionReason = congestionReasonLoss
|
||||
}
|
||||
case lossQueuingRegion == queuingRegionJQR:
|
||||
c.queuingRegion = queuingRegionJQR
|
||||
c.congestionReason = congestionReasonLoss
|
||||
case qdQueuingRegion == queuingRegionDQR && lossQueuingRegion == queuingRegionDQR:
|
||||
c.queuingRegion = queuingRegionDQR
|
||||
c.congestionReason = congestionReasonNone
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ func (ts *trafficStats) AcknowledgedBitrate() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
ackedBitrate := int64(ts.ackedBytes) * 8 * 1e6 / ts.Duration()
|
||||
return int64(float64(ackedBitrate) * ts.CapturedTrafficRatio())
|
||||
ackedBitrate := float64(ts.ackedBytes) * 8 * 1e6 / float64(ts.Duration())
|
||||
return int64(ackedBitrate * ts.CapturedTrafficRatio())
|
||||
}
|
||||
|
||||
func (ts *trafficStats) CapturedTrafficRatio() float64 {
|
||||
|
||||
Reference in New Issue
Block a user