Telemetry connection scores (#377)
* octets - total bytes needs to be uint64 uint32 wraps at 4GB Signed-off-by: shishir gowda <shishir@livekit.io> * Cleanup stats handler to use connectionQuality stats remove per packet rtcp handlers, buffer stats * cleanup connection stats * Update mediatrack to store rtcp stats in connection stats * Update downstream handling of connection stats and telemetry * Update telemetry tests Signed-off-by: shishir gowda <shishir@livekit.io> * Misc fixes Signed-off-by: shishir gowda <shishir@livekit.io> * Minor fix to avoid accessing buffer before its allocated Signed-off-by: shishir gowda <shishir@livekit.io> * start updateStats worker in AddReciever() Signed-off-by: shishir gowda <shishir@livekit.io> * Use previous score to calculate avg scores * Restructure connectionStats Signed-off-by: shishir gowda <shishir@livekit.io>
This commit is contained in:
@@ -250,7 +250,7 @@ func TestConnectionQuality(t *testing.T) {
|
||||
if numRegistered > 0 && numPublishing != numRegistered {
|
||||
reducedQuality = true
|
||||
}
|
||||
return connectionquality.Loss2Score(loss, reducedQuality)
|
||||
return connectionquality.VideoConnectionScore(loss, reducedQuality)
|
||||
}
|
||||
|
||||
testPublishedVideoTrack := func(loss, numPublishing, numRegistered uint32) *typesfakes.FakeLocalMediaTrack {
|
||||
@@ -264,16 +264,20 @@ func TestConnectionQuality(t *testing.T) {
|
||||
testPublishedAudioTrack := func(totalPackets, packetsLost uint32) *typesfakes.FakeLocalMediaTrack {
|
||||
tr := &typesfakes.FakeLocalMediaTrack{}
|
||||
|
||||
stat := &connectionquality.ConnectionStat{
|
||||
stat := connectionquality.ConnectionStat{
|
||||
PacketsLost: packetsLost,
|
||||
TotalPackets: totalPackets,
|
||||
LastSeqNum: 0,
|
||||
}
|
||||
stats := &connectionquality.ConnectionStats{
|
||||
Curr: stat,
|
||||
Prev: &connectionquality.ConnectionStat{},
|
||||
ConnectionStat: stat,
|
||||
Prev: &connectionquality.ConnectionStat{},
|
||||
}
|
||||
stats.CalculateAudioScore()
|
||||
stats.Score = connectionquality.AudioConnectionScore(connectionquality.ConnectionStat{
|
||||
TotalPackets: stat.TotalPackets,
|
||||
PacketsLost: stat.PacketsLost,
|
||||
TotalBytes: stat.TotalBytes,
|
||||
}, 0)
|
||||
t.Log("audio score: ", stats.Score)
|
||||
tr.GetConnectionScoreReturns(stats.Score)
|
||||
return tr
|
||||
|
||||
Reference in New Issue
Block a user