Kaynağa Gözat

feat: Displays the E2E RTT in the connection stats table. (#3344)

* feat: Displays the E2E RTT in the connection stats table.

* fix: Whitelists the ping config properties.

* ref: Addresses feedback.

* npm: Updates lib-jitsi-meet to e097a1189e.

* ref: Moves the e2ertt and region to the existing stats object.
master
bgrozev 6 yıl önce
ebeveyn
işleme
2ee1bf9351

+ 12
- 0
config.js Dosyayı Görüntüle

@@ -347,6 +347,18 @@ var config = {
347 347
         // userRegion: "asia"
348 348
     }
349 349
 
350
+    // Options related to end-to-end (participant to participant) ping.
351
+    // e2eping: {
352
+    //   // The interval in milliseconds at which pings will be sent.
353
+    //   // Defaults to 10000, set to <= 0 to disable.
354
+    //   pingInterval: 10000,
355
+    //
356
+    //   // The interval in milliseconds at which analytics events
357
+    //   // with the measured RTT will be sent. Defaults to 60000, set
358
+    //   // to <= 0 to disable.
359
+    //   analyticsInterval: 60000,
360
+    //   }
361
+
350 362
     // List of undocumented settings used in jitsi-meet
351 363
     /**
352 364
      _immediateReloadThreshold

+ 1
- 0
lang/main.json Dosyayı Görüntüle

@@ -198,6 +198,7 @@
198 198
         "packetloss": "Packet loss:",
199 199
         "resolution": "Resolution:",
200 200
         "framerate": "Frame rate:",
201
+        "e2e_rtt": "E2E RTT:",
201 202
         "less": "Show less",
202 203
         "more": "Show more",
203 204
         "address": "Address:",

+ 5
- 5
package-lock.json Dosyayı Görüntüle

@@ -9719,8 +9719,8 @@
9719 9719
       }
9720 9720
     },
9721 9721
     "lib-jitsi-meet": {
9722
-      "version": "github:jitsi/lib-jitsi-meet#2be752fc88ff71e454c6b9178b21a33b59c53f41",
9723
-      "from": "github:jitsi/lib-jitsi-meet#2be752fc88ff71e454c6b9178b21a33b59c53f41",
9722
+      "version": "github:jitsi/lib-jitsi-meet#e097a1189ed99838605d90b959e129155bc0e50a",
9723
+      "from": "github:jitsi/lib-jitsi-meet#e097a1189ed99838605d90b959e129155bc0e50a",
9724 9724
       "requires": {
9725 9725
         "@jitsi/sdp-interop": "0.1.13",
9726 9726
         "@jitsi/sdp-simulcast": "0.2.1",
@@ -14298,9 +14298,9 @@
14298 14298
       }
14299 14299
     },
14300 14300
     "sdp": {
14301
-      "version": "2.7.4",
14302
-      "resolved": "https://registry.npmjs.org/sdp/-/sdp-2.7.4.tgz",
14303
-      "integrity": "sha512-0+wTfgvUUEGcvvFoHIC0aiGbx6gzwAUm8FkKt5Oqqkjf9mEEDLgwnoDKX7MYTGXrNNwzikVbutJ+OVNAGmJBQw=="
14301
+      "version": "2.8.0",
14302
+      "resolved": "https://registry.npmjs.org/sdp/-/sdp-2.8.0.tgz",
14303
+      "integrity": "sha512-wRSES07rAwKWAR7aev9UuClT7kdf9ZTdeUK5gTgHue9vlhs19Fbm3ccNEGJO4y2IitH4/JzS4sdzyPl6H2KQLw=="
14304 14304
     },
14305 14305
     "sdp-transform": {
14306 14306
       "version": "2.3.0",

+ 1
- 1
package.json Dosyayı Görüntüle

@@ -47,7 +47,7 @@
47 47
     "js-md5": "0.6.1",
48 48
     "jsc-android": "224109.1.0",
49 49
     "jwt-decode": "2.2.0",
50
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#2be752fc88ff71e454c6b9178b21a33b59c53f41",
50
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#e097a1189ed99838605d90b959e129155bc0e50a",
51 51
     "lodash": "4.17.4",
52 52
     "moment": "2.19.4",
53 53
     "moment-duration-format": "2.2.2",

+ 1
- 0
react/features/base/config/functions.js Dosyayı Görüntüle

@@ -96,6 +96,7 @@ const WHITELISTED_KEYS = [
96 96
     'disableRtx',
97 97
     'disableSuspendVideo',
98 98
     'displayJids',
99
+    'e2eping',
99 100
     'enableDisplayNameInStats',
100 101
     'enableLayerSuspension',
101 102
     'enableLipSync',

+ 1
- 0
react/features/base/lib-jitsi-meet/index.js Dosyayı Görüntüle

@@ -14,6 +14,7 @@ export const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
14 14
 export const JitsiConnectionEvents = JitsiMeetJS.events.connection;
15 15
 export const JitsiConnectionQualityEvents
16 16
     = JitsiMeetJS.events.connectionQuality;
17
+export const JitsiE2ePingEvents = JitsiMeetJS.events.e2eping;
17 18
 export const JitsiMediaDevicesEvents = JitsiMeetJS.events.mediaDevices;
18 19
 export const JitsiParticipantConnectionStatus
19 20
     = JitsiMeetJS.constants.participantConnectionStatus;

+ 5
- 1
react/features/connection-indicator/components/ConnectionIndicator.js Dosyayı Görüntüle

@@ -324,6 +324,7 @@ class ConnectionIndicator extends Component {
324 324
      * @returns {void}
325 325
      */
326 326
     _onStatsUpdated(stats = {}) {
327
+        // Rely on React to batch setState actions.
327 328
         const { connectionQuality } = stats;
328 329
         const newPercentageState = typeof connectionQuality === 'undefined'
329 330
             ? {} : { percent: connectionQuality };
@@ -337,7 +338,6 @@ class ConnectionIndicator extends Component {
337 338
             stats: newStats
338 339
         });
339 340
 
340
-        // Rely on React to batch setState actions.
341 341
         this._updateIndicatorAutoHide(newStats.percent);
342 342
     }
343 343
 
@@ -410,8 +410,10 @@ class ConnectionIndicator extends Component {
410 410
         const {
411 411
             bandwidth,
412 412
             bitrate,
413
+            e2eRtt,
413 414
             framerate,
414 415
             packetLoss,
416
+            region,
415 417
             resolution,
416 418
             transport
417 419
         } = this.state.stats;
@@ -421,10 +423,12 @@ class ConnectionIndicator extends Component {
421 423
                 bandwidth = { bandwidth }
422 424
                 bitrate = { bitrate }
423 425
                 connectionSummary = { this._getConnectionStatusTip() }
426
+                e2eRtt = { e2eRtt }
424 427
                 framerate = { framerate }
425 428
                 isLocalVideo = { this.props.isLocalVideo }
426 429
                 onShowMore = { this._onToggleShowMore }
427 430
                 packetLoss = { packetLoss }
431
+                region = { region }
428 432
                 resolution = { resolution }
429 433
                 shouldShowMore = { this.state.showMoreStats }
430 434
                 transport = { transport } />

+ 15
- 1
react/features/connection-indicator/statsEmitter.js Dosyayı Görüntüle

@@ -2,7 +2,10 @@
2 2
 
3 3
 import _ from 'lodash';
4 4
 
5
-import { JitsiConnectionQualityEvents } from '../base/lib-jitsi-meet';
5
+import {
6
+    JitsiConnectionQualityEvents,
7
+    JitsiE2ePingEvents
8
+} from '../base/lib-jitsi-meet';
6 9
 
7 10
 declare var APP: Object;
8 11
 
@@ -33,6 +36,17 @@ const statsEmitter = {
33 36
 
34 37
         conference.on(JitsiConnectionQualityEvents.REMOTE_STATS_UPDATED,
35 38
             (id, stats) => this._emitStatsUpdate(id, stats));
39
+
40
+        conference.on(
41
+            JitsiE2ePingEvents.E2E_RTT_CHANGED,
42
+            (participant, e2eRtt) => {
43
+                const stats = {
44
+                    e2eRtt,
45
+                    region: participant.getProperty('region')
46
+                };
47
+
48
+                this._emitStatsUpdate(participant.getId(), stats);
49
+            });
36 50
     },
37 51
 
38 52
     /**

+ 36
- 2
react/features/connection-stats/components/ConnectionStatsTable.js Dosyayı Görüntüle

@@ -39,7 +39,12 @@ class ConnectionStatsTable extends Component {
39 39
         connectionSummary: PropTypes.string,
40 40
 
41 41
         /**
42
-         * Statistics related to framerates for each ssrc.
42
+         * The end-to-end round-trip-time.
43
+         */
44
+        e2eRtt: PropTypes.number,
45
+
46
+        /**
47
+         * Statistics related to frame rates for each ssrc.
43 48
          * {{
44 49
          *     [ ssrc ]: Number
45 50
          * }}
@@ -47,7 +52,7 @@ class ConnectionStatsTable extends Component {
47 52
         framerate: PropTypes.object,
48 53
 
49 54
         /**
50
-         * Whether or not the statitics are for local video.
55
+         * Whether or not the statistics are for local video.
51 56
          */
52 57
         isLocalVideo: PropTypes.bool,
53 58
 
@@ -65,6 +70,11 @@ class ConnectionStatsTable extends Component {
65 70
          */
66 71
         packetLoss: PropTypes.object,
67 72
 
73
+        /**
74
+         * The region.
75
+         */
76
+        region: PropTypes.string,
77
+
68 78
         /**
69 79
          * Statistics related to display resolutions for each ssrc.
70 80
          * {{
@@ -208,6 +218,27 @@ class ConnectionStatsTable extends Component {
208 218
         );
209 219
     }
210 220
 
221
+    /**
222
+     * Creates a table row as a ReactElement for displaying end-to-end RTT and
223
+     * the region.
224
+     *
225
+     * @returns {ReactElement}
226
+     * @private
227
+     */
228
+    _renderE2eRtt() {
229
+        const { e2eRtt, region, t } = this.props;
230
+        const str = `${e2eRtt.toFixed(0)}ms (${region ? region : 'unknown'})`;
231
+
232
+        return (
233
+            <tr>
234
+                <td>
235
+                    <span>{ t('connectionindicator.e2e_rtt') }</span>
236
+                </td>
237
+                <td>{ str }</td>
238
+            </tr>
239
+        );
240
+    }
241
+
211 242
     /**
212 243
      * Creates a table row as a ReactElement for displaying frame rate related
213 244
      * statistics.
@@ -330,12 +361,15 @@ class ConnectionStatsTable extends Component {
330 361
      * @returns {ReactElement}
331 362
      */
332 363
     _renderStatistics() {
364
+        const isRemoteVideo = !this.props.isLocalVideo;
365
+
333 366
         return (
334 367
             <table className = 'connection-info__container'>
335 368
                 <tbody>
336 369
                     { this._renderConnectionSummary() }
337 370
                     { this._renderBitrate() }
338 371
                     { this._renderPacketLoss() }
372
+                    { isRemoteVideo ? this._renderE2eRtt() : null }
339 373
                     { this._renderResolution() }
340 374
                     { this._renderFrameRate() }
341 375
                 </tbody>

Loading…
İptal
Kaydet