浏览代码

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
 import traceInit from '@jitsi/rtcstats/trace-ws';
4
 import traceInit from '@jitsi/rtcstats/trace-ws';
5
 
5
 
6
 import {
6
 import {
7
+    CONFERENCE_CREATED_TIMESTAMP,
7
     CONFERENCE_JOINED,
8
     CONFERENCE_JOINED,
8
     CONFERENCE_LEFT,
9
     CONFERENCE_LEFT,
9
     CONFERENCE_UNIQUE_ID_SET
10
     CONFERENCE_UNIQUE_ID_SET
12
 import { IRTCStatsConfiguration } from './interfaces';
13
 import { IRTCStatsConfiguration } from './interfaces';
13
 import { RTC_STATS_PC_EVENT, RTC_STATS_WC_DISCONNECTED } from './RTCStatsEvents';
14
 import { RTC_STATS_PC_EVENT, RTC_STATS_WC_DISCONNECTED } from './RTCStatsEvents';
14
 import EventEmitter from '../util/EventEmitter';
15
 import EventEmitter from '../util/EventEmitter';
16
+import Settings from '../settings/Settings';
15
 
17
 
16
 const logger = getLogger(__filename);
18
 const logger = getLogger(__filename);
17
 
19
 
84
             } = {}
86
             } = {}
85
         } = confConfig;
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
         // Reset the trace module in case it wasn't during the previous conference.
99
         // Reset the trace module in case it wasn't during the previous conference.
88
         // Closing the underlying websocket connection and deleting the trace obj.
100
         // Closing the underlying websocket connection and deleting the trace obj.
89
         this.reset();
101
         this.reset();
125
                 confName,
137
                 confName,
126
                 displayName,
138
                 displayName,
127
                 meetingUniqueId,
139
                 meetingUniqueId,
128
-                isBreakoutRoom
140
+                isBreakoutRoom,
141
+                localId
129
             }
142
             }
130
 
143
 
131
             this.sendIdentity(identityData);
144
             this.sendIdentity(identityData);
139
         conference.once(CONFERENCE_LEFT, () => {
152
         conference.once(CONFERENCE_LEFT, () => {
140
             this.reset();
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
     /**

正在加载...
取消
保存