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 authored and GitHub committed 2025-02-04 00:59:56 +05:30
1 parent 2f758d49ce
commit f45e3613ac
2 files changed
+9 -2

No files matched your search

+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
}