Add stats for data channel and signal (#1198)

* Add stats for data channel and signal

* Solve comment
This commit is contained in:
cnderrauber
2022-11-30 14:53:19 +08:00
committed by GitHub
parent caae389717
commit 3c907ed460
13 changed files with 217 additions and 46 deletions
+6 -2
View File
@@ -104,12 +104,16 @@ func (p *ParticipantImpl) SendSpeakerUpdate(speakers []*livekit.SpeakerInfo) err
})
}
func (p *ParticipantImpl) SendDataPacket(dp *livekit.DataPacket) error {
func (p *ParticipantImpl) SendDataPacket(dp *livekit.DataPacket, data []byte) error {
if p.State() != livekit.ParticipantInfo_ACTIVE {
return ErrDataChannelUnavailable
}
return p.TransportManager.SendDataPacket(dp)
err := p.TransportManager.SendDataPacket(dp, data)
if err == nil {
p.dataChannelStats.AddBytes(uint64(len(data)), true)
}
return err
}
func (p *ParticipantImpl) SendRoomUpdate(room *livekit.Room) error {