Przeglądaj źródła

Adds option to send email as identifier in stats.

dev1
damencho 6 lat temu
rodzic
commit
fe988ae391

+ 7
- 1
JitsiConference.js Wyświetl plik

285
     }
285
     }
286
 
286
 
287
     const { config } = this.options;
287
     const { config } = this.options;
288
-    const statsCurrentId = Settings.callStatsUserName;
288
+    const statsCurrentId = config.enableEmailInStats && config.email
289
+        ? config.email : Settings.callStatsUserName;
289
 
290
 
290
     if (config.enableStatsID) {
291
     if (config.enableStatsID) {
291
         config.statsId = statsCurrentId;
292
         config.statsId = statsCurrentId;
378
             applicationName: config.applicationName,
379
             applicationName: config.applicationName,
379
             getWiFiStatsMethod: config.getWiFiStatsMethod
380
             getWiFiStatsMethod: config.getWiFiStatsMethod
380
         });
381
         });
382
+        Statistics.analytics.addPermanentProperties({
383
+            'callstats_name': aliasName,
384
+            'user_agent': navigator.userAgent,
385
+            'browser_name': browser.getName()
386
+        });
381
     }
387
     }
382
 
388
 
383
     this.eventManager.setupChatRoomListeners();
389
     this.eventManager.setupChatRoomListeners();

+ 1
- 0
doc/API.md Wyświetl plik

229
         9. enableDisplayNameInStats - enables sending the users display name, if set, to callstats as alias of the endpointID stats
229
         9. enableDisplayNameInStats - enables sending the users display name, if set, to callstats as alias of the endpointID stats
230
         10. startSilent - enables silent mode, will mark audio as inactive will not send/receive audio
230
         10. startSilent - enables silent mode, will mark audio as inactive will not send/receive audio
231
         11. confID - Used for statistics to identify conference, if tenants are supported will contain tenant and the non lower case variant for the room name.
231
         11. confID - Used for statistics to identify conference, if tenants are supported will contain tenant and the non lower case variant for the room name.
232
+        12. enableEmailInStats - enables sending the users emails to callstats as id of the endpointID stats, set as presence so it can reach jicofo and jvb to use it when reporting, set as id to the anlytics
232
 
233
 
233
         **NOTE: if 4 and 5 are set the library is going to send events to callstats. Otherwise the callstats integration will be disabled.**
234
         **NOTE: if 4 and 5 are set the library is going to send events to callstats. Otherwise the callstats integration will be disabled.**
234
 
235
 

+ 3
- 14
modules/statistics/AnalyticsAdapter.js Wyświetl plik

5
     TYPE_UI
5
     TYPE_UI
6
 } from '../../service/statistics/AnalyticsEvents';
6
 } from '../../service/statistics/AnalyticsEvents';
7
 import { getLogger } from 'jitsi-meet-logger';
7
 import { getLogger } from 'jitsi-meet-logger';
8
-import browser from '../browser';
9
 
8
 
10
 const MAX_CACHE_SIZE = 100;
9
 const MAX_CACHE_SIZE = 100;
11
 
10
 
54
  * action, actionSubject, source, containerType, containerId, objectType,
53
  * action, actionSubject, source, containerType, containerId, objectType,
55
  * objectId
54
  * objectId
56
  */
55
  */
57
-export default class AnalyticsAdapter {
58
-    /**
59
-     * The options to configure Statistics.
60
-     * @typedef {Object} AnalyticsOptions
61
-     * @property {string} statsId - The id that will be used to be passed with all analytics for current session.
62
-     */
56
+class AnalyticsAdapter {
63
     /**
57
     /**
64
      * Creates new AnalyticsAdapter instance.
58
      * Creates new AnalyticsAdapter instance.
65
-     * @param {AnalyticsOptions} options - The options to use creating the AnalyticsAdapter.
66
      */
59
      */
67
     constructor(options) {
60
     constructor(options) {
68
         this.options = options;
61
         this.options = options;
108
          * @type {null}
101
          * @type {null}
109
          */
102
          */
110
         this.conferenceName = '';
103
         this.conferenceName = '';
111
-
112
-        this.addPermanentProperties({
113
-            'callstats_name': this.options.statsId,
114
-            'user_agent': navigator.userAgent,
115
-            'browser_name': browser.getName()
116
-        });
117
     }
104
     }
118
 
105
 
119
     /**
106
     /**
357
         }
344
         }
358
     }
345
     }
359
 }
346
 }
347
+
348
+export default new AnalyticsAdapter();

+ 2
- 5
modules/statistics/statistics.js Wyświetl plik

1
 import EventEmitter from 'events';
1
 import EventEmitter from 'events';
2
 
2
 
3
 import { FEEDBACK } from '../../service/statistics/AnalyticsEvents';
3
 import { FEEDBACK } from '../../service/statistics/AnalyticsEvents';
4
-import Analytics from './AnalyticsAdapter';
4
+import analytics from './AnalyticsAdapter';
5
 import CallStats from './CallStats';
5
 import CallStats from './CallStats';
6
 import LocalStats from './LocalStatsCollector';
6
 import LocalStats from './LocalStatsCollector';
7
 import RTPStats from './RTPStatsCollector';
7
 import RTPStats from './RTPStatsCollector';
151
     this.xmpp = xmpp;
151
     this.xmpp = xmpp;
152
     this.options = options || {};
152
     this.options = options || {};
153
 
153
 
154
-    Statistics.analytics = new Analytics({
155
-        statsId: this.options.aliasName
156
-    });
157
-
158
     this.callStatsIntegrationEnabled
154
     this.callStatsIntegrationEnabled
159
         = this.options.callStatsID && this.options.callStatsSecret
155
         = this.options.callStatsID && this.options.callStatsSecret
160
 
156
 
191
 Statistics.audioLevelsEnabled = false;
187
 Statistics.audioLevelsEnabled = false;
192
 Statistics.audioLevelsInterval = 200;
188
 Statistics.audioLevelsInterval = 200;
193
 Statistics.disableThirdPartyRequests = false;
189
 Statistics.disableThirdPartyRequests = false;
190
+Statistics.analytics = analytics;
194
 
191
 
195
 Object.defineProperty(Statistics, 'instances', {
192
 Object.defineProperty(Statistics, 'instances', {
196
     /**
193
     /**

Ładowanie…
Anuluj
Zapisz