( ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, nodeID livekit.NodeID, reason livekit.ReconnectReason, )
| 144 | } |
| 145 | |
| 146 | func (t *telemetryService) ParticipantResumed( |
| 147 | ctx context.Context, |
| 148 | room *livekit.Room, |
| 149 | participant *livekit.ParticipantInfo, |
| 150 | nodeID livekit.NodeID, |
| 151 | reason livekit.ReconnectReason, |
| 152 | ) { |
| 153 | t.enqueue(func() { |
| 154 | // create a worker if needed. |
| 155 | // |
| 156 | // Signalling channel stats collector and media channel stats collector could both call |
| 157 | // ParticipantJoined and ParticipantLeft. |
| 158 | // |
| 159 | // On a resume, the signalling channel collector would call `ParticipantLeft` which would close |
| 160 | // the corresponding participant's stats worker. |
| 161 | // |
| 162 | // So, on a successful resume, create the worker if needed. |
| 163 | _, found := t.getOrCreateWorker( |
| 164 | ctx, |
| 165 | livekit.RoomID(room.Sid), |
| 166 | livekit.RoomName(room.Name), |
| 167 | livekit.ParticipantID(participant.Sid), |
| 168 | livekit.ParticipantIdentity(participant.Identity), |
| 169 | nil, |
| 170 | ) |
| 171 | if !found { |
| 172 | prometheus.AddParticipant() |
| 173 | } |
| 174 | |
| 175 | ev := newParticipantEvent(livekit.AnalyticsEventType_PARTICIPANT_RESUMED, room, participant) |
| 176 | ev.ClientMeta = &livekit.AnalyticsClientMeta{ |
| 177 | Node: string(nodeID), |
| 178 | ReconnectReason: reason, |
| 179 | } |
| 180 | t.SendEvent(ctx, ev) |
| 181 | }) |
| 182 | } |
| 183 | |
| 184 | func (t *telemetryService) ParticipantLeft(ctx context.Context, |
| 185 | room *livekit.Room, |
nothing calls this directly
no test coverage detected