File tree Expand file tree Collapse file tree 5 files changed +43
-2
lines changed
Expand file tree Collapse file tree 5 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @livekit/protocol " : patch
3+ ---
4+
5+ add session features to room observability
Original file line number Diff line number Diff line change 66 "time"
77)
88
9- const Version_LNTFR10 = true
9+ const Version_JNN296G = true
1010
1111type KeyResolver interface {
1212 Resolve (string )
@@ -43,6 +43,7 @@ type RoomReporter interface {
4343type RoomSessionTx interface {
4444 ReportStartTime (v time.Time )
4545 ReportEndTime (v time.Time )
46+ ReportFeatures (v uint16 )
4647}
4748
4849type RoomSessionReporter interface {
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ func (r *noopRoomSessionReporter) Tx(f func(RoomSessionTx))
7878func (r * noopRoomSessionReporter ) TxAt (ts time.Time , f func (RoomSessionTx )) {}
7979func (r * noopRoomSessionReporter ) ReportStartTime (v time.Time ) {}
8080func (r * noopRoomSessionReporter ) ReportEndTime (v time.Time ) {}
81+ func (r * noopRoomSessionReporter ) ReportFeatures (v uint16 ) {}
8182func (r * noopRoomSessionReporter ) WithParticipant (identity string ) ParticipantReporter {
8283 return & noopParticipantReporter {}
8384}
Original file line number Diff line number Diff line change @@ -87,5 +87,6 @@ const (
8787 RollupParticipantSession Rollup = "participant_session"
8888 RollupTrackIndex Rollup = "track_index"
8989 RollupTrack Rollup = "track"
90- RollupProjectRoomIndex Rollup = "project_room_index"
90+ RollupStartTimeIndex Rollup = "start_time_index"
91+ RollupEndTimeIndex Rollup = "end_time_index"
9192)
Original file line number Diff line number Diff line change @@ -96,3 +96,36 @@ func TrackSourceFromProto(p livekit.TrackSource) TrackSource {
9696 return TrackSourceUndefined
9797 }
9898}
99+
100+ type RoomFeature uint16
101+
102+ func (f RoomFeature ) HasIngress () bool { return f & IngressRoomFeature != 0 }
103+ func (f RoomFeature ) HasEgress () bool { return f & EgressRoomFeature != 0 }
104+ func (f RoomFeature ) HasSIP () bool { return f & SIPRoomFeature != 0 }
105+ func (f RoomFeature ) HasAgent () bool { return f & AgentRoomFeature != 0 }
106+ func (f RoomFeature ) HasConnector () bool { return f & ConnectorRoomFeature != 0 }
107+
108+ const (
109+ IngressRoomFeature RoomFeature = 1 << iota
110+ EgressRoomFeature
111+ SIPRoomFeature
112+ AgentRoomFeature
113+ ConnectorRoomFeature
114+ )
115+
116+ func RoomFeatureFromParticipantKind (k livekit.ParticipantInfo_Kind ) RoomFeature {
117+ switch k {
118+ case livekit .ParticipantInfo_INGRESS :
119+ return IngressRoomFeature
120+ case livekit .ParticipantInfo_EGRESS :
121+ return EgressRoomFeature
122+ case livekit .ParticipantInfo_SIP :
123+ return SIPRoomFeature
124+ case livekit .ParticipantInfo_AGENT :
125+ return AgentRoomFeature
126+ case livekit .ParticipantInfo_CONNECTOR :
127+ return ConnectorRoomFeature
128+ default :
129+ return 0
130+ }
131+ }
You can’t perform that action at this time.
0 commit comments