Participant traffic load. (#2262)
* Participant traffic load. Capturing information about participant traffic - Upstream/Downstream - Audio/Video/Data - Packets/Bytes This captures a notion of how much traffic load a participant is generating. Can be used to make allocation decisions. * Clean up * SIP patches * reporter goroutine * unlock * move traffic stats from protocol * check type
This commit is contained in:
@@ -828,4 +828,20 @@ func (t *MediaTrackReceiver) IsEncrypted() bool {
|
||||
return t.trackInfo.Encryption != livekit.Encryption_NONE
|
||||
}
|
||||
|
||||
func (t *MediaTrackReceiver) GetTrackStats() *livekit.RTPStats {
|
||||
t.lock.Lock()
|
||||
receivers := t.receiversShadow
|
||||
t.lock.Unlock()
|
||||
|
||||
stats := make([]*livekit.RTPStats, 0, len(receivers))
|
||||
for _, receiver := range receivers {
|
||||
receiverStats := receiver.GetTrackStats()
|
||||
if receiverStats != nil {
|
||||
stats = append(stats, receiverStats)
|
||||
}
|
||||
}
|
||||
|
||||
return buffer.AggregateRTPStats(stats)
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
|
||||
Reference in New Issue
Block a user