Correct reason for poor/lost score. (#3397)

No functional change, just logging reason was confusing.
Also, log no packets case. Seeing some instances in staging where there
are periods of no packets received. Trying to understand better.
This commit is contained in:
Raja Subramanian
2025-02-04 00:59:56 +05:30
committed by GitHub
parent 2f758d49ce
commit f45e3613ac
2 changed files with 9 additions and 2 deletions
+2 -2
View File
@@ -408,10 +408,10 @@ func (q *qualityScorer) updateAtLocked(stat *windowStat, at time.Time) {
var score, packetScore, bitrateScore, layerScore float64
if stat.packets+stat.packetsPadding == 0 {
if !stat.lastRTCPAt.IsZero() && at.Sub(stat.lastRTCPAt) > stat.duration {
reason = "dry"
reason = "rtcp"
score = qualityTransitionScore[livekit.ConnectionQuality_LOST]
} else {
reason = "rtcp"
reason = "dry"
score = qualityTransitionScore[livekit.ConnectionQuality_POOR]
}
} else {
+7
View File
@@ -468,6 +468,13 @@ func (r *rtpStatsBase) deltaInfo(
StartTime: time.Unix(0, startTime),
EndTime: time.Unix(0, endTime),
}
loggingFields = []interface{}{
"snapshotID", snapshotID,
"snapshotNow", now,
"snapshotThen", then,
"duration", time.Duration(endTime - startTime),
}
err = errors.New("no packets in delta")
return
}