Use RTT field in analytics stats (#304)
* Update protocol to v0.11.7 * Use RTT field in analytics stats Instead of Delay
This commit is contained in:
@@ -93,8 +93,8 @@ func (s *StatsWorker) OnRTCP(trackID livekit.TrackID, direction livekit.StreamTy
|
||||
}
|
||||
ds.totalPacketsLost = stats.PacketLost
|
||||
|
||||
if stats.Delay > ds.next.Delay {
|
||||
ds.next.Delay = stats.Delay
|
||||
if stats.Rtt > ds.next.Rtt {
|
||||
ds.next.Rtt = stats.Rtt
|
||||
}
|
||||
if stats.Jitter > ds.next.Jitter {
|
||||
ds.next.Jitter = stats.Jitter
|
||||
|
||||
@@ -76,7 +76,7 @@ func (t *telemetryServiceInternal) HandleRTCP(streamType livekit.StreamType, par
|
||||
if streamType == livekit.StreamType_DOWNSTREAM {
|
||||
rtt := GetRttMs(pkt)
|
||||
if rtt >= 0 {
|
||||
stats.Delay = uint64(rtt)
|
||||
stats.Rtt = uint32(rtt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ func Test_OnDownStreamRTCP(t *testing.T) {
|
||||
require.Equal(t, 1, int(stats[0].NackCount))
|
||||
require.Equal(t, 1, int(stats[0].PliCount))
|
||||
require.Equal(t, 1, int(stats[0].FirCount))
|
||||
require.Equal(t, 0, int(stats[0].Delay)) // TODO: test for RTT
|
||||
require.Equal(t, 0, int(stats[0].Rtt)) // TODO: test for RTT
|
||||
require.Equal(t, 5, int(stats[0].Jitter)) // max of jitter, see list of rtcp.ReceptionReport above
|
||||
require.Equal(t, 4, int(stats[0].PacketLost)) // last reported packets lost, see list of rtcp.ReceptionReport above
|
||||
require.Equal(t, trackID, stats[0].TrackId)
|
||||
@@ -290,7 +290,7 @@ func Test_OnUpstreamRTCP(t *testing.T) {
|
||||
require.Equal(t, 1, int(stats[0].NackCount))
|
||||
require.Equal(t, 1, int(stats[0].PliCount))
|
||||
require.Equal(t, 1, int(stats[0].FirCount))
|
||||
require.Equal(t, 0, int(stats[0].Delay)) // TODO: test for RTT
|
||||
require.Equal(t, 0, int(stats[0].Rtt)) // TODO: test for RTT
|
||||
require.Equal(t, 5, int(stats[0].Jitter)) // max of jitter, see list of rtcp.ReceptionReport above
|
||||
require.Equal(t, 4, int(stats[0].PacketLost)) // last reported packets lost, see list of rtcp.ReceptionReport above
|
||||
require.Equal(t, trackID, stats[0].TrackId)
|
||||
|
||||
Reference in New Issue
Block a user