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) {
|
func (cs *ConnectionStats) UpdateMute(isMuted bool, at time.Time) {
|
||||||
|
/* TODO-RESTORE
|
||||||
|
if cs.done.IsBroken() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
cs.scorer.UpdateMute(isMuted, at)
|
cs.scorer.UpdateMute(isMuted, at)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cs *ConnectionStats) AddBitrateTransition(bitrate int64, at time.Time) {
|
func (cs *ConnectionStats) AddBitrateTransition(bitrate int64, at time.Time) {
|
||||||
|
/* TODO-RESTORE
|
||||||
|
if cs.done.IsBroken() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
cs.scorer.AddBitrateTransition(bitrate, at)
|
cs.scorer.AddBitrateTransition(bitrate, at)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cs *ConnectionStats) UpdateLayerMute(isMuted bool, at time.Time) {
|
func (cs *ConnectionStats) UpdateLayerMute(isMuted bool, at time.Time) {
|
||||||
|
/* TODO-RESTORE
|
||||||
|
if cs.done.IsBroken() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
cs.scorer.UpdateLayerMute(isMuted, at)
|
cs.scorer.UpdateLayerMute(isMuted, at)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cs *ConnectionStats) AddLayerTransition(distance float64, at time.Time) {
|
func (cs *ConnectionStats) AddLayerTransition(distance float64, at time.Time) {
|
||||||
|
/* TODO-RESTORE
|
||||||
|
if cs.done.IsBroken() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
cs.scorer.AddLayerTransition(distance, at)
|
cs.scorer.AddLayerTransition(distance, at)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,10 +277,9 @@ func (cs *ConnectionStats) updateStatsWorker() {
|
|||||||
tk := time.NewTicker(interval)
|
tk := time.NewTicker(interval)
|
||||||
defer tk.Stop()
|
defer tk.Stop()
|
||||||
|
|
||||||
done := cs.done.Watch()
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-done:
|
case <-cs.done.Watch():
|
||||||
return
|
return
|
||||||
|
|
||||||
case <-tk.C:
|
case <-tk.C:
|
||||||
|
|||||||
@@ -252,6 +252,8 @@ func (q *qualityScorer) AddLayerTransition(distance float64, at time.Time) {
|
|||||||
q.lock.Lock()
|
q.lock.Lock()
|
||||||
defer q.lock.Unlock()
|
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{
|
q.layerTransitions = append(q.layerTransitions, layerTransition{
|
||||||
startedAt: at,
|
startedAt: at,
|
||||||
distance: distance,
|
distance: distance,
|
||||||
@@ -262,6 +264,9 @@ func (q *qualityScorer) Update(stat *windowStat, at time.Time) {
|
|||||||
q.lock.Lock()
|
q.lock.Lock()
|
||||||
defer q.lock.Unlock()
|
defer q.lock.Unlock()
|
||||||
|
|
||||||
|
// TODO-REMOVE-AFTER-DEBUG
|
||||||
|
q.params.Logger.Debugw("running update", "at", at, "stat", stat)
|
||||||
|
|
||||||
// always update transitions
|
// always update transitions
|
||||||
expectedBitrate := q.getExpectedBitsAndUpdateTransitions(at)
|
expectedBitrate := q.getExpectedBitsAndUpdateTransitions(at)
|
||||||
expectedDistance := q.getExpectedDistanceAndUpdateTransitions(at)
|
expectedDistance := q.getExpectedDistanceAndUpdateTransitions(at)
|
||||||
|
|||||||
Reference in New Issue
Block a user