mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 13:25:42 +00:00
Server-driven connection quality detection (#167)
This commit is contained in:
@@ -53,7 +53,6 @@ func initPacketStats() {
|
||||
}
|
||||
|
||||
type PacketStats struct {
|
||||
roomName string
|
||||
direction string // incoming or outgoing
|
||||
|
||||
PacketBytes uint64 `json:"packetBytes"`
|
||||
@@ -63,9 +62,8 @@ type PacketStats struct {
|
||||
FIRTotal uint64 `json:"firTotal"`
|
||||
}
|
||||
|
||||
func newPacketStats(room, direction string) *PacketStats {
|
||||
func newPacketStats(direction string) *PacketStats {
|
||||
return &PacketStats{
|
||||
roomName: room,
|
||||
direction: direction,
|
||||
}
|
||||
}
|
||||
@@ -121,7 +119,6 @@ func (s *PacketStats) HandleRTCP(pkts []rtcp.Packet) {
|
||||
|
||||
func (s PacketStats) Copy() *PacketStats {
|
||||
return &PacketStats{
|
||||
roomName: s.roomName,
|
||||
direction: s.direction,
|
||||
PacketBytes: atomic.LoadUint64(&s.PacketBytes),
|
||||
PacketTotal: atomic.LoadUint64(&s.PacketTotal),
|
||||
|
||||
@@ -60,11 +60,10 @@ type RoomStatsReporter struct {
|
||||
Outgoing *PacketStats
|
||||
}
|
||||
|
||||
func NewRoomStatsReporter(roomName string) *RoomStatsReporter {
|
||||
func NewRoomStatsReporter() *RoomStatsReporter {
|
||||
return &RoomStatsReporter{
|
||||
roomName: roomName,
|
||||
Incoming: newPacketStats(roomName, "incoming"),
|
||||
Outgoing: newPacketStats(roomName, "outgoing"),
|
||||
Incoming: newPacketStats("incoming"),
|
||||
Outgoing: newPacketStats("outgoing"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user