mirror of
https://github.com/livekit/livekit.git
synced 2026-09-01 20:09:08 +00:00
Logging more to understand layer transition leak better. (#1840)
This commit is contained in:
@@ -81,18 +81,42 @@ func (cs *ConnectionStats) OnStatsUpdate(fn func(cs *ConnectionStats, stat *live
|
||||
}
|
||||
|
||||
func (cs *ConnectionStats) UpdateMute(isMuted bool, at time.Time) {
|
||||
/* TODO-RESTORE
|
||||
if cs.done.IsBroken() {
|
||||
return
|
||||
}
|
||||
*/
|
||||
|
||||
cs.scorer.UpdateMute(isMuted, at)
|
||||
}
|
||||
|
||||
func (cs *ConnectionStats) AddBitrateTransition(bitrate int64, at time.Time) {
|
||||
/* TODO-RESTORE
|
||||
if cs.done.IsBroken() {
|
||||
return
|
||||
}
|
||||
*/
|
||||
|
||||
cs.scorer.AddBitrateTransition(bitrate, at)
|
||||
}
|
||||
|
||||
func (cs *ConnectionStats) UpdateLayerMute(isMuted bool, at time.Time) {
|
||||
/* TODO-RESTORE
|
||||
if cs.done.IsBroken() {
|
||||
return
|
||||
}
|
||||
*/
|
||||
|
||||
cs.scorer.UpdateLayerMute(isMuted, at)
|
||||
}
|
||||
|
||||
func (cs *ConnectionStats) AddLayerTransition(distance float64, at time.Time) {
|
||||
/* TODO-RESTORE
|
||||
if cs.done.IsBroken() {
|
||||
return
|
||||
}
|
||||
*/
|
||||
|
||||
cs.scorer.AddLayerTransition(distance, at)
|
||||
}
|
||||
|
||||
@@ -253,10 +277,9 @@ func (cs *ConnectionStats) updateStatsWorker() {
|
||||
tk := time.NewTicker(interval)
|
||||
defer tk.Stop()
|
||||
|
||||
done := cs.done.Watch()
|
||||
for {
|
||||
select {
|
||||
case <-done:
|
||||
case <-cs.done.Watch():
|
||||
return
|
||||
|
||||
case <-tk.C:
|
||||
|
||||
@@ -252,6 +252,8 @@ func (q *qualityScorer) AddLayerTransition(distance float64, at time.Time) {
|
||||
q.lock.Lock()
|
||||
defer q.lock.Unlock()
|
||||
|
||||
// TODO-REMOVE-AFTER-DEBUG
|
||||
q.params.Logger.Debugw("adding layer transition", "at", at, "distance", distance)
|
||||
q.layerTransitions = append(q.layerTransitions, layerTransition{
|
||||
startedAt: at,
|
||||
distance: distance,
|
||||
@@ -262,6 +264,9 @@ func (q *qualityScorer) Update(stat *windowStat, at time.Time) {
|
||||
q.lock.Lock()
|
||||
defer q.lock.Unlock()
|
||||
|
||||
// TODO-REMOVE-AFTER-DEBUG
|
||||
q.params.Logger.Debugw("running update", "at", at, "stat", stat)
|
||||
|
||||
// always update transitions
|
||||
expectedBitrate := q.getExpectedBitsAndUpdateTransitions(at)
|
||||
expectedDistance := q.getExpectedDistanceAndUpdateTransitions(at)
|
||||
|
||||
Reference in New Issue
Block a user