瀏覽代碼

feat(rtcstats): move conference start time to ljm (#2544)

release-8443
Andrei Gavrilescu 1 年之前
父節點
當前提交
2f65997cb9
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 18 行新增1 行删除
  1. 18
    1
      modules/RTCStats/RTCStats.ts

+ 18
- 1
modules/RTCStats/RTCStats.ts 查看文件

@@ -4,6 +4,7 @@ import rtcstatsInit from '@jitsi/rtcstats/rtcstats';
4 4
 import traceInit from '@jitsi/rtcstats/trace-ws';
5 5
 
6 6
 import {
7
+    CONFERENCE_CREATED_TIMESTAMP,
7 8
     CONFERENCE_JOINED,
8 9
     CONFERENCE_LEFT,
9 10
     CONFERENCE_UNIQUE_ID_SET
@@ -12,6 +13,7 @@ import JitsiConference from '../../JitsiConference';
12 13
 import { IRTCStatsConfiguration } from './interfaces';
13 14
 import { RTC_STATS_PC_EVENT, RTC_STATS_WC_DISCONNECTED } from './RTCStatsEvents';
14 15
 import EventEmitter from '../util/EventEmitter';
16
+import Settings from '../settings/Settings';
15 17
 
16 18
 const logger = getLogger(__filename);
17 19
 
@@ -84,6 +86,16 @@ class RTCStats {
84 86
             } = {}
85 87
         } = confConfig;
86 88
 
89
+        // The statisticsId, statisticsDisplayName and _statsCurrentId (renamed to displayName) fields 
90
+        // that are sent through options might be a bit confusing. Depending on the context, they could 
91
+        // be intermixed inside ljm, for instance _statsCurrentId might refer to the email field which is stored
92
+        // in statisticsId or it could have the same value as callStatsUserName.
93
+        // The following is the mapping between the fields, and a short explanation of each:
94
+        // statisticsId -> email, this is only send by jitsi-meet if enableEmailInStats option is set.
95
+        // statisticsDisplayName -> nick, this is only send by jitsi-meet if enableDisplayNameInStats option is set.
96
+        // localId, this is the unique id that is used to track users throughout stats.
97
+        const localId = Settings?.callStatsUserName ?? '';
98
+
87 99
         // Reset the trace module in case it wasn't during the previous conference.
88 100
         // Closing the underlying websocket connection and deleting the trace obj.
89 101
         this.reset();
@@ -125,7 +137,8 @@ class RTCStats {
125 137
                 confName,
126 138
                 displayName,
127 139
                 meetingUniqueId,
128
-                isBreakoutRoom
140
+                isBreakoutRoom,
141
+                localId
129 142
             }
130 143
 
131 144
             this.sendIdentity(identityData);
@@ -139,6 +152,10 @@ class RTCStats {
139 152
         conference.once(CONFERENCE_LEFT, () => {
140 153
             this.reset();
141 154
         });
155
+
156
+        conference.once(CONFERENCE_CREATED_TIMESTAMP, (timestamp: number) => {
157
+            this.sendStatsEntry('conferenceStartTimestamp', null, timestamp);
158
+        })
142 159
     }
143 160
 
144 161
     /**

Loading…
取消
儲存