Pushes e2e pings to rtcstats (#11270)

* Pushes e2e pings to rtcstats

* linter fixes

* linter fixes

* Re-use existing event instead of introducing a new one.

* Don't update the connection info popup stats when the e2e rtt changes.

* Bumps ljm version to the latest

* e2e pings should work on mobile

* tweak the e2eRttChanged action properties

* fixes comments
This commit is contained in:
George Politis 2022-04-01 13:50:52 +01:00 committed by GitHub
parent 1e58a7cbec
commit 84ac6298eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 80 additions and 22 deletions

View File

@ -44,6 +44,7 @@ import {
conferenceWillJoin, conferenceWillJoin,
conferenceWillLeave, conferenceWillLeave,
dataChannelOpened, dataChannelOpened,
e2eRttChanged,
getConferenceOptions, getConferenceOptions,
kickedOut, kickedOut,
lockStateChanged, lockStateChanged,
@ -69,6 +70,7 @@ import {
JitsiConferenceEvents, JitsiConferenceEvents,
JitsiConnectionErrors, JitsiConnectionErrors,
JitsiConnectionEvents, JitsiConnectionEvents,
JitsiE2ePingEvents,
JitsiMediaDevicesEvents, JitsiMediaDevicesEvents,
JitsiParticipantConnectionStatus, JitsiParticipantConnectionStatus,
JitsiTrackErrors, JitsiTrackErrors,
@ -2343,6 +2345,10 @@ export default {
APP.store.dispatch(setVideoUnmutePermissions(disableVideoMuteChange)); APP.store.dispatch(setVideoUnmutePermissions(disableVideoMuteChange));
}); });
room.on(
JitsiE2ePingEvents.E2E_RTT_CHANGED,
(...args) => APP.store.dispatch(e2eRttChanged(...args)));
APP.UI.addListener(UIEvents.AUDIO_MUTED, muted => { APP.UI.addListener(UIEvents.AUDIO_MUTED, muted => {
this.muteAudio(muted); this.muteAudio(muted);
}); });

10
package-lock.json generated
View File

@ -74,7 +74,7 @@
"jquery-i18next": "1.2.1", "jquery-i18next": "1.2.1",
"js-md5": "0.6.1", "js-md5": "0.6.1",
"jwt-decode": "2.2.0", "jwt-decode": "2.2.0",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1409.0.0+88378583/lib-jitsi-meet.tgz", "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1410.0.0+3b38ab37/lib-jitsi-meet.tgz",
"libflacjs": "https://git@github.com/mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d", "libflacjs": "https://git@github.com/mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
"lodash": "4.17.21", "lodash": "4.17.21",
"moment": "2.29.1", "moment": "2.29.1",
@ -11814,8 +11814,8 @@
}, },
"node_modules/lib-jitsi-meet": { "node_modules/lib-jitsi-meet": {
"version": "0.0.0", "version": "0.0.0",
"resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1409.0.0+88378583/lib-jitsi-meet.tgz", "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1410.0.0+3b38ab37/lib-jitsi-meet.tgz",
"integrity": "sha512-c6WfdRVZl1cLl+oCKggMXk7yoYVTnvMU6kL8q9g3TtiNCocpBlh6HPLz9/A2DzLzCcyNio5KeNucyX7Ir3EXbA==", "integrity": "sha512-NbQyYmdGLjkFhSxc+1TbKDN8SY/wxD2q8VZps64k49JGIu+cExann+jlH/z63KZR/keFc7FxAZeq2Ax4ymB4Ng==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@jitsi/js-utils": "2.0.0", "@jitsi/js-utils": "2.0.0",
@ -28825,8 +28825,8 @@
} }
}, },
"lib-jitsi-meet": { "lib-jitsi-meet": {
"version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1409.0.0+88378583/lib-jitsi-meet.tgz", "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1410.0.0+3b38ab37/lib-jitsi-meet.tgz",
"integrity": "sha512-c6WfdRVZl1cLl+oCKggMXk7yoYVTnvMU6kL8q9g3TtiNCocpBlh6HPLz9/A2DzLzCcyNio5KeNucyX7Ir3EXbA==", "integrity": "sha512-NbQyYmdGLjkFhSxc+1TbKDN8SY/wxD2q8VZps64k49JGIu+cExann+jlH/z63KZR/keFc7FxAZeq2Ax4ymB4Ng==",
"requires": { "requires": {
"@jitsi/js-utils": "2.0.0", "@jitsi/js-utils": "2.0.0",
"@jitsi/logger": "2.0.0", "@jitsi/logger": "2.0.0",

View File

@ -79,7 +79,7 @@
"jquery-i18next": "1.2.1", "jquery-i18next": "1.2.1",
"js-md5": "0.6.1", "js-md5": "0.6.1",
"jwt-decode": "2.2.0", "jwt-decode": "2.2.0",
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1409.0.0+88378583/lib-jitsi-meet.tgz", "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1410.0.0+3b38ab37/lib-jitsi-meet.tgz",
"libflacjs": "https://git@github.com/mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d", "libflacjs": "https://git@github.com/mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
"lodash": "4.17.21", "lodash": "4.17.21",
"moment": "2.29.1", "moment": "2.29.1",

View File

@ -82,6 +82,19 @@ export const CONFERENCE_TIMESTAMP_CHANGED = 'CONFERENCE_TIMESTAMP_CHANGED';
*/ */
export const CONFERENCE_UNIQUE_ID_SET = 'CONFERENCE_UNIQUE_ID_SET'; export const CONFERENCE_UNIQUE_ID_SET = 'CONFERENCE_UNIQUE_ID_SET';
/**
* The type of (redux) action which signals that the end-to-end RTT against a specific remote participant has changed.
*
* {
* type: E2E_RTT_CHANGED,
* e2eRtt: {
* rtt: number,
* participant: Object,
* }
* }
*/
export const E2E_RTT_CHANGED = 'E2E_RTT_CHANGED'
/** /**
* The type of (redux) action which signals that a specific conference will be * The type of (redux) action which signals that a specific conference will be
* joined. * joined.

View File

@ -9,7 +9,7 @@ import {
import { endpointMessageReceived } from '../../subtitles'; import { endpointMessageReceived } from '../../subtitles';
import { getReplaceParticipant } from '../config/functions'; import { getReplaceParticipant } from '../config/functions';
import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection'; import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection';
import { JitsiConferenceEvents } from '../lib-jitsi-meet'; import { JitsiConferenceEvents, JitsiE2ePingEvents } from '../lib-jitsi-meet';
import { import {
MEDIA_TYPE, MEDIA_TYPE,
setAudioMuted, setAudioMuted,
@ -48,6 +48,7 @@ import {
CONFERENCE_WILL_JOIN, CONFERENCE_WILL_JOIN,
CONFERENCE_WILL_LEAVE, CONFERENCE_WILL_LEAVE,
DATA_CHANNEL_OPENED, DATA_CHANNEL_OPENED,
E2E_RTT_CHANGED,
KICKED_OUT, KICKED_OUT,
LOCK_STATE_CHANGED, LOCK_STATE_CHANGED,
NON_PARTICIPANT_MESSAGE_RECEIVED, NON_PARTICIPANT_MESSAGE_RECEIVED,
@ -231,6 +232,10 @@ function _addConferenceListeners(conference, dispatch, state) {
JitsiConferenceEvents.USER_STATUS_CHANGED, JitsiConferenceEvents.USER_STATUS_CHANGED,
(...args) => dispatch(participantPresenceChanged(...args))); (...args) => dispatch(participantPresenceChanged(...args)));
conference.on(
JitsiE2ePingEvents.E2E_RTT_CHANGED,
(...args) => dispatch(e2eRttChanged(...args)));
conference.on( conference.on(
JitsiConferenceEvents.BOT_TYPE_CHANGED, JitsiConferenceEvents.BOT_TYPE_CHANGED,
(id, botType) => dispatch(participantUpdated({ (id, botType) => dispatch(participantUpdated({
@ -255,6 +260,30 @@ function _addConferenceListeners(conference, dispatch, state) {
}))); })));
} }
/**
* Create an action for when the end-to-end RTT against a specific remote participant has changed.
*
* @param {Object} participant - The participant against which the rtt is measured.
* @param {number} rtt - The rtt.
* @returns {{
* type: E2E_RTT_CHANGED,
* e2eRtt: {
* participant: Object,
* rtt: number
* }
* }}
*/
export function e2eRttChanged(participant, rtt) {
return {
type: E2E_RTT_CHANGED,
e2eRtt: {
rtt,
participant
}
};
}
/** /**
* Updates the current known state of server-side authentication. * Updates the current known state of server-side authentication.
* *

View File

@ -3,8 +3,7 @@
import _ from 'lodash'; import _ from 'lodash';
import { import {
JitsiConnectionQualityEvents, JitsiConnectionQualityEvents
JitsiE2ePingEvents
} from '../base/lib-jitsi-meet'; } from '../base/lib-jitsi-meet';
/** /**
@ -34,17 +33,6 @@ const statsEmitter = {
conference.on(JitsiConnectionQualityEvents.REMOTE_STATS_UPDATED, conference.on(JitsiConnectionQualityEvents.REMOTE_STATS_UPDATED,
(id, stats) => this._emitStatsUpdate(id, stats)); (id, stats) => this._emitStatsUpdate(id, stats));
conference.on(
JitsiE2ePingEvents.E2E_RTT_CHANGED,
(participant, e2eRtt) => {
const stats = {
e2eRtt,
region: participant.getProperty('region')
};
this._emitStatsUpdate(participant.getId(), stats);
});
}, },
/** /**

View File

@ -95,6 +95,16 @@ class RTCStats {
this.trace && this.trace.statsEntry('dominantSpeaker', null, dominantSpeakerData); this.trace && this.trace.statsEntry('dominantSpeaker', null, dominantSpeakerData);
} }
/**
* Send e2e rtt data, the data will be processed by rtcstats-server and saved in the dump file.
*
* @param {Object} e2eRttData - The object that holds the e2e data.
* @returns {void}
*/
sendE2eRttData(e2eRttData) {
this.trace && this.trace.statsEntry('e2eRtt', null, e2eRttData);
}
/** /**
* Send facial expression data, the data will be processed by rtcstats-server and saved in the dump file. * Send facial expression data, the data will be processed by rtcstats-server and saved in the dump file.
* *

View File

@ -3,7 +3,7 @@
import { jitsiLocalStorage } from '@jitsi/js-utils'; import { jitsiLocalStorage } from '@jitsi/js-utils';
import { getAmplitudeIdentity } from '../analytics'; import { getAmplitudeIdentity } from '../analytics';
import { CONFERENCE_UNIQUE_ID_SET, getConferenceOptions, getRoomName } from '../base/conference'; import { CONFERENCE_UNIQUE_ID_SET, E2E_RTT_CHANGED, getConferenceOptions, getRoomName } from '../base/conference';
import { LIB_WILL_INIT } from '../base/lib-jitsi-meet'; import { LIB_WILL_INIT } from '../base/lib-jitsi-meet';
import { DOMINANT_SPEAKER_CHANGED, getLocalParticipant } from '../base/participants'; import { DOMINANT_SPEAKER_CHANGED, getLocalParticipant } from '../base/participants';
import { MiddlewareRegistry } from '../base/redux'; import { MiddlewareRegistry } from '../base/redux';
@ -105,6 +105,18 @@ MiddlewareRegistry.register(store => next => action => {
} }
break; break;
} }
case E2E_RTT_CHANGED: {
if (canSendRtcstatsData(state)) {
const { participant, rtt } = action.e2eRtt;
RTCStats.sendE2eRttData({
remoteEndpointId: participant.getId(),
rtt,
remoteRegion: participant.getProperty('region')
});
}
break;
}
case ADD_FACIAL_EXPRESSION: { case ADD_FACIAL_EXPRESSION: {
if (canSendRtcstatsData(state)) { if (canSendRtcstatsData(state)) {
const { duration, facialExpression } = action; const { duration, facialExpression } = action;