Stats collect v2 (#1291)

* initial commit

* add correct label

* clean up

* more cleanup on adding stats

* cleanup

* move things to pub and sub monitors, ensure stats are correctly updated

* fix merge conflict

* Fix panic on MacOS (#1296)

* fixing last feedback

Co-authored-by: Raja Subramanian <raja.gobi@tutanota.com>
This commit is contained in:
Dan McFaul
2023-01-11 14:49:50 -07:00
committed by GitHub
co-authored by Raja Subramanian
parent 0ca80a4fa7
commit 4d6f0cd0f7
14 changed files with 147 additions and 273 deletions
+4 -3
View File
@@ -4,10 +4,11 @@ import (
"sync"
"time"
"go.uber.org/atomic"
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"go.uber.org/atomic"
)
const (
@@ -91,7 +92,7 @@ func (p *ParticipantSupervisor) SetPublisherPeerConnectionConnected(isConnected
p.lock.Unlock()
}
func (p *ParticipantSupervisor) AddPublication(trackID livekit.TrackID) {
func (p *ParticipantSupervisor) AddPublication(trackID livekit.TrackID, trackType livekit.TrackType) {
p.lock.Lock()
pm, ok := p.publications[trackID]
if !ok {
@@ -106,7 +107,7 @@ func (p *ParticipantSupervisor) AddPublication(trackID livekit.TrackID) {
}
p.publications[trackID] = pm
}
pm.opMon.PostEvent(types.OperationMonitorEventAddPendingPublication, nil)
pm.opMon.PostEvent(types.OperationMonitorEventAddPendingPublication, trackType.String())
p.lock.Unlock()
}