|
|
@@ -136,6 +136,7 @@ import {
|
|
136
|
136
|
isUserInteractionRequiredForUnmute
|
|
137
|
137
|
} from './react/features/base/tracks/functions';
|
|
138
|
138
|
import { downloadJSON } from './react/features/base/util/downloadJSON';
|
|
|
139
|
+import { getJitsiMeetGlobalNSConnectionTimes } from './react/features/base/util/helpers';
|
|
139
|
140
|
import { openLeaveReasonDialog } from './react/features/conference/actions.web';
|
|
140
|
141
|
import { showDesktopPicker } from './react/features/desktop-picker/actions';
|
|
141
|
142
|
import { appendSuffix } from './react/features/display-name/functions';
|
|
|
@@ -413,9 +414,10 @@ export default {
|
|
413
|
414
|
* without any audio tracks.
|
|
414
|
415
|
* @param {boolean} options.startWithVideoMuted - will start the conference
|
|
415
|
416
|
* without any video tracks.
|
|
|
417
|
+ * @param {boolean} recordTimeMetrics - If true time metrics will be recorded.
|
|
416
|
418
|
* @returns {Promise<JitsiLocalTrack[]>, Object}
|
|
417
|
419
|
*/
|
|
418
|
|
- createInitialLocalTracks(options = {}) {
|
|
|
420
|
+ createInitialLocalTracks(options = {}, recordTimeMetrics = false) {
|
|
419
|
421
|
const errors = {};
|
|
420
|
422
|
|
|
421
|
423
|
// Always get a handle on the audio input device so that we have statistics (such as "No audio input" or
|
|
|
@@ -487,7 +489,7 @@ export default {
|
|
487
|
489
|
devices: initialDevices,
|
|
488
|
490
|
timeout,
|
|
489
|
491
|
firePermissionPromptIsShownEvent: true
|
|
490
|
|
- })).then(({ tracks, errors: pErrors }) => {
|
|
|
492
|
+ }, recordTimeMetrics)).then(({ tracks, errors: pErrors }) => {
|
|
491
|
493
|
Object.assign(errors, pErrors);
|
|
492
|
494
|
|
|
493
|
495
|
return tracks;
|
|
|
@@ -571,8 +573,12 @@ export default {
|
|
571
|
573
|
startWithAudioMuted: getStartWithAudioMuted(state) || isUserInteractionRequiredForUnmute(state),
|
|
572
|
574
|
startWithVideoMuted: getStartWithVideoMuted(state) || isUserInteractionRequiredForUnmute(state)
|
|
573
|
575
|
};
|
|
|
576
|
+ const connectionTimes = getJitsiMeetGlobalNSConnectionTimes();
|
|
|
577
|
+ const startTime = window.performance.now();
|
|
574
|
578
|
|
|
575
|
|
- logger.debug(`Executed conference.init with roomName: ${roomName}`);
|
|
|
579
|
+ connectionTimes['conference.init.start'] = startTime;
|
|
|
580
|
+
|
|
|
581
|
+ logger.debug(`Executed conference.init with roomName: ${roomName} (performance.now=${startTime})`);
|
|
576
|
582
|
|
|
577
|
583
|
this.roomName = roomName;
|
|
578
|
584
|
|
|
|
@@ -605,9 +611,19 @@ export default {
|
|
605
|
611
|
return localTracks;
|
|
606
|
612
|
};
|
|
607
|
613
|
const { dispatch, getState } = APP.store;
|
|
608
|
|
- const { tryCreateLocalTracks, errors } = this.createInitialLocalTracks(initialOptions);
|
|
|
614
|
+ const createLocalTracksStart = window.performance.now();
|
|
|
615
|
+
|
|
|
616
|
+ connectionTimes['conference.init.createLocalTracks.start'] = createLocalTracksStart;
|
|
|
617
|
+
|
|
|
618
|
+ logger.debug(`(TIME) createInitialLocalTracks: ${createLocalTracksStart} `);
|
|
|
619
|
+
|
|
|
620
|
+ const { tryCreateLocalTracks, errors } = this.createInitialLocalTracks(initialOptions, true);
|
|
609
|
621
|
|
|
610
|
622
|
tryCreateLocalTracks.then(async tr => {
|
|
|
623
|
+ const createLocalTracksEnd = window.performance.now();
|
|
|
624
|
+
|
|
|
625
|
+ connectionTimes['conference.init.createLocalTracks.end'] = createLocalTracksEnd;
|
|
|
626
|
+ logger.debug(`(TIME) createInitialLocalTracks finished: ${createLocalTracksEnd} `);
|
|
611
|
627
|
const tracks = handleInitialTracks(initialOptions, tr);
|
|
612
|
628
|
|
|
613
|
629
|
this._initDeviceList(true);
|
|
|
@@ -621,6 +637,8 @@ export default {
|
|
621
|
637
|
// which will guarantee us that the local tracks are added to redux before we proceed.
|
|
622
|
638
|
initPrejoin(tracks, errors, dispatch);
|
|
623
|
639
|
|
|
|
640
|
+ connectionTimes['conference.init.end'] = window.performance.now();
|
|
|
641
|
+
|
|
624
|
642
|
// resolve the initialGUMPromise in case connect have finished so that we can proceed to join.
|
|
625
|
643
|
if (initialGUMPromise) {
|
|
626
|
644
|
logger.debug('Resolving the initialGUM promise! (prejoinVisible=true)');
|
|
|
@@ -639,6 +657,7 @@ export default {
|
|
639
|
657
|
APP.store.dispatch(displayErrorsForCreateInitialLocalTracks(errors));
|
|
640
|
658
|
setGUMPendingStateOnFailedTracks(tracks, APP.store.dispatch);
|
|
641
|
659
|
|
|
|
660
|
+ connectionTimes['conference.init.end'] = window.performance.now();
|
|
642
|
661
|
if (initialGUMPromise) {
|
|
643
|
662
|
logger.debug('Resolving the initialGUM promise!');
|
|
644
|
663
|
initialGUMPromise.resolve({
|