mirror of
https://github.com/livekit/livekit.git
synced 2026-05-24 21:15:36 +00:00
Send client sdk type when participant joins in telemetry (#275)
Signed-off-by: shishir gowda <shishir@livekit.io>
This commit is contained in:
@@ -273,7 +273,7 @@ func (r *RoomManager) StartSession(ctx context.Context, roomName string, pi rout
|
||||
}
|
||||
}
|
||||
|
||||
r.telemetry.ParticipantJoined(ctx, room.Room, participant.ToProto())
|
||||
r.telemetry.ParticipantJoined(ctx, room.Room, participant.ToProto(), pi.Client)
|
||||
participant.OnClose(func(p types.Participant) {
|
||||
if err := r.roomStore.DeleteParticipant(ctx, roomName, p.Identity()); err != nil {
|
||||
pLogger.Errorw("could not delete participant", err)
|
||||
|
||||
@@ -24,7 +24,7 @@ type TelemetryService interface {
|
||||
// events
|
||||
RoomStarted(ctx context.Context, room *livekit.Room)
|
||||
RoomEnded(ctx context.Context, room *livekit.Room)
|
||||
ParticipantJoined(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo)
|
||||
ParticipantJoined(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, clientInfo *livekit.ClientInfo)
|
||||
ParticipantLeft(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo)
|
||||
TrackPublished(ctx context.Context, participantID string, track *livekit.TrackInfo)
|
||||
TrackUnpublished(ctx context.Context, participantID string, track *livekit.TrackInfo, ssrc uint32)
|
||||
|
||||
@@ -43,7 +43,8 @@ func (t *telemetryService) RoomEnded(ctx context.Context, room *livekit.Room) {
|
||||
})
|
||||
}
|
||||
|
||||
func (t *telemetryService) ParticipantJoined(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo) {
|
||||
func (t *telemetryService) ParticipantJoined(ctx context.Context, room *livekit.Room,
|
||||
participant *livekit.ParticipantInfo, clientInfo *livekit.ClientInfo) {
|
||||
t.Lock()
|
||||
t.workers[participant.Sid] = newStatsWorker(ctx, t, room.Sid, room.Name, participant.Sid)
|
||||
t.Unlock()
|
||||
@@ -62,6 +63,7 @@ func (t *telemetryService) ParticipantJoined(ctx context.Context, room *livekit.
|
||||
RoomSid: room.Sid,
|
||||
Participant: participant,
|
||||
Room: room,
|
||||
SdkType: clientInfo.GetSdk(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,9 @@ func Test_TelemetryService_Downstream_Stats(t *testing.T) {
|
||||
|
||||
room := &livekit.Room{}
|
||||
partSID := "part1"
|
||||
clientInfo := &livekit.ClientInfo{Sdk: 2}
|
||||
participantInfo := &livekit.ParticipantInfo{Sid: partSID}
|
||||
fixture.sut.ParticipantJoined(context.Background(), room, participantInfo)
|
||||
fixture.sut.ParticipantJoined(context.Background(), room, participantInfo, clientInfo)
|
||||
totalBytes := 33
|
||||
fixture.sut.OnDownstreamPacket(partSID, totalBytes)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user