Browse Source

Displays the region participants are connected to (#3451)

* feat: Displays the server region in the stats panels.

* feat: Displays the server count in the local stats panel.

* ref: Renames a variable.

* fix: Makes bridgeCount a number, clarifies docs.

* chore: Updates lib-jitsi-meet to 1ac6df97e3.
j8
bgrozev 7 years ago
parent
commit
d051d3450d
No account linked to committer's email address

+ 2
- 0
lang/main.json View File

207
     "connectionindicator":
207
     "connectionindicator":
208
     {
208
     {
209
         "header": "Connection data",
209
         "header": "Connection data",
210
+        "connectedTo": "Connected to:",
210
         "bitrate": "Bitrate:",
211
         "bitrate": "Bitrate:",
212
+        "bridgeCount": "Server count: ",
211
         "packetloss": "Packet loss:",
213
         "packetloss": "Packet loss:",
212
         "resolution": "Resolution:",
214
         "resolution": "Resolution:",
213
         "framerate": "Frame rate:",
215
         "framerate": "Frame rate:",

+ 14
- 8
package-lock.json View File

9318
       }
9318
       }
9319
     },
9319
     },
9320
     "lib-jitsi-meet": {
9320
     "lib-jitsi-meet": {
9321
-      "version": "github:jitsi/lib-jitsi-meet#3f46c64f4f373d3b573fcc55b59568dbe9b9d51f",
9322
-      "from": "github:jitsi/lib-jitsi-meet#3f46c64f4f373d3b573fcc55b59568dbe9b9d51f",
9321
+      "version": "github:jitsi/lib-jitsi-meet#1ac6df97e3aa5ff880129a95754d491d89ea8c25",
9322
+      "from": "github:jitsi/lib-jitsi-meet#1ac6df97e3aa5ff880129a95754d491d89ea8c25",
9323
       "requires": {
9323
       "requires": {
9324
         "@jitsi/sdp-interop": "0.1.13",
9324
         "@jitsi/sdp-interop": "0.1.13",
9325
         "@jitsi/sdp-simulcast": "0.2.1",
9325
         "@jitsi/sdp-simulcast": "0.2.1",
9327
         "current-executing-script": "0.1.3",
9327
         "current-executing-script": "0.1.3",
9328
         "jitsi-meet-logger": "github:jitsi/jitsi-meet-logger#6fff754a77a56ab52499f3559105a15886942a1e",
9328
         "jitsi-meet-logger": "github:jitsi/jitsi-meet-logger#6fff754a77a56ab52499f3559105a15886942a1e",
9329
         "js-utils": "github:jitsi/js-utils#d4b78721b754a15c2588b7b0c621a9fff6fa1363",
9329
         "js-utils": "github:jitsi/js-utils#d4b78721b754a15c2588b7b0c621a9fff6fa1363",
9330
+        "lodash.isequal": "4.5.0",
9330
         "react-native-callstats": "3.53.4",
9331
         "react-native-callstats": "3.53.4",
9331
         "sdp-transform": "2.3.0",
9332
         "sdp-transform": "2.3.0",
9332
         "strophe.js": "1.2.15",
9333
         "strophe.js": "1.2.15",
9410
       "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=",
9411
       "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=",
9411
       "dev": true
9412
       "dev": true
9412
     },
9413
     },
9414
+    "lodash.isequal": {
9415
+      "version": "4.5.0",
9416
+      "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
9417
+      "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
9418
+    },
9413
     "lodash.memoize": {
9419
     "lodash.memoize": {
9414
       "version": "4.1.2",
9420
       "version": "4.1.2",
9415
       "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
9421
       "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
12879
       "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw=="
12885
       "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw=="
12880
     },
12886
     },
12881
     "rtcpeerconnection-shim": {
12887
     "rtcpeerconnection-shim": {
12882
-      "version": "1.2.13",
12883
-      "resolved": "https://registry.npmjs.org/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.13.tgz",
12884
-      "integrity": "sha512-Xz4zQLZNs9lFBvqbaHGIjLWtyZ1V82ec5r+WNEo7NlIx3zF5M3ytn9mkkfYeZmpE032cNg3Vvf0rP8kNXUNd9w==",
12888
+      "version": "1.2.14",
12889
+      "resolved": "https://registry.npmjs.org/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.14.tgz",
12890
+      "integrity": "sha512-/sl1vgarkFPU2rbXy+EMmytMQIzCKNbIm3fChjPnsdytKAROgoivB0KLE7PQRjKx/d/nr/Yx+6qu0/eCpoxn/A==",
12885
       "requires": {
12891
       "requires": {
12886
         "sdp": "^2.6.0"
12892
         "sdp": "^2.6.0"
12887
       }
12893
       }
13940
       }
13946
       }
13941
     },
13947
     },
13942
     "sdp": {
13948
     "sdp": {
13943
-      "version": "2.8.0",
13944
-      "resolved": "https://registry.npmjs.org/sdp/-/sdp-2.8.0.tgz",
13945
-      "integrity": "sha512-wRSES07rAwKWAR7aev9UuClT7kdf9ZTdeUK5gTgHue9vlhs19Fbm3ccNEGJO4y2IitH4/JzS4sdzyPl6H2KQLw=="
13949
+      "version": "2.9.0",
13950
+      "resolved": "https://registry.npmjs.org/sdp/-/sdp-2.9.0.tgz",
13951
+      "integrity": "sha512-XAVZQO4qsfzVTHorF49zCpkdxiGmPNjA8ps8RcJGtGP3QJ/A8I9/SVg/QnkAFDMXIyGbHZBBFwYBw6WdnhT96w=="
13946
     },
13952
     },
13947
     "sdp-transform": {
13953
     "sdp-transform": {
13948
       "version": "2.3.0",
13954
       "version": "2.3.0",

+ 1
- 1
package.json View File

49
     "jsc-android": "224109.1.0",
49
     "jsc-android": "224109.1.0",
50
     "jsrsasign": "8.0.12",
50
     "jsrsasign": "8.0.12",
51
     "jwt-decode": "2.2.0",
51
     "jwt-decode": "2.2.0",
52
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#3f46c64f4f373d3b573fcc55b59568dbe9b9d51f",
52
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#1ac6df97e3aa5ff880129a95754d491d89ea8c25",
53
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
53
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
54
     "lodash": "4.17.4",
54
     "lodash": "4.17.4",
55
     "moment": "2.19.4",
55
     "moment": "2.19.4",

+ 4
- 0
react/features/connection-indicator/components/ConnectionIndicator.js View File

410
         const {
410
         const {
411
             bandwidth,
411
             bandwidth,
412
             bitrate,
412
             bitrate,
413
+            bridgeCount,
413
             e2eRtt,
414
             e2eRtt,
414
             framerate,
415
             framerate,
415
             packetLoss,
416
             packetLoss,
416
             region,
417
             region,
417
             resolution,
418
             resolution,
419
+            serverRegion,
418
             transport
420
             transport
419
         } = this.state.stats;
421
         } = this.state.stats;
420
 
422
 
422
             <ConnectionStatsTable
424
             <ConnectionStatsTable
423
                 bandwidth = { bandwidth }
425
                 bandwidth = { bandwidth }
424
                 bitrate = { bitrate }
426
                 bitrate = { bitrate }
427
+                bridgeCount = { bridgeCount }
425
                 connectionSummary = { this._getConnectionStatusTip() }
428
                 connectionSummary = { this._getConnectionStatusTip() }
426
                 e2eRtt = { e2eRtt }
429
                 e2eRtt = { e2eRtt }
427
                 framerate = { framerate }
430
                 framerate = { framerate }
430
                 packetLoss = { packetLoss }
433
                 packetLoss = { packetLoss }
431
                 region = { region }
434
                 region = { region }
432
                 resolution = { resolution }
435
                 resolution = { resolution }
436
+                serverRegion = { serverRegion }
433
                 shouldShowMore = { this.state.showMoreStats }
437
                 shouldShowMore = { this.state.showMoreStats }
434
                 transport = { transport } />
438
                 transport = { transport } />
435
         );
439
         );

+ 9
- 9
react/features/connection-indicator/statsEmitter.js View File

116
      * also update listeners of remote user stats of changes related to their
116
      * also update listeners of remote user stats of changes related to their
117
      * stats.
117
      * stats.
118
      *
118
      *
119
-     * @param {string} currentUserId - The user id for the local user.
119
+     * @param {string} localUserId - The user id for the local user.
120
      * @param {Object} stats - Connection stats for the local user as provided
120
      * @param {Object} stats - Connection stats for the local user as provided
121
      * by the library.
121
      * by the library.
122
      * @returns {void}
122
      * @returns {void}
123
      */
123
      */
124
-    _onStatsUpdated(currentUserId: string, stats: Object) {
124
+    _onStatsUpdated(localUserId: string, stats: Object) {
125
         const allUserFramerates = stats.framerate || {};
125
         const allUserFramerates = stats.framerate || {};
126
         const allUserResolutions = stats.resolution || {};
126
         const allUserResolutions = stats.resolution || {};
127
 
127
 
128
-        // FIXME resolution and framerate are hashes keyed off of user ids with
128
+        // FIXME resolution and framerate are maps keyed off of user ids with
129
         // stat values. Receivers of stats expect resolution and framerate to
129
         // stat values. Receivers of stats expect resolution and framerate to
130
-        // be primatives, not hashes, so overwrites the 'lib-jitsi-meet' stats
131
-        // objects.
130
+        // be primitives, not maps, so here we override the 'lib-jitsi-meet'
131
+        // stats objects.
132
         const modifiedLocalStats = Object.assign({}, stats, {
132
         const modifiedLocalStats = Object.assign({}, stats, {
133
-            framerate: allUserFramerates[currentUserId],
134
-            resolution: allUserResolutions[currentUserId]
133
+            framerate: allUserFramerates[localUserId],
134
+            resolution: allUserResolutions[localUserId]
135
         });
135
         });
136
 
136
 
137
-        this._emitStatsUpdate(currentUserId, modifiedLocalStats);
137
+        this._emitStatsUpdate(localUserId, modifiedLocalStats);
138
 
138
 
139
         // Get all the unique user ids from the framerate and resolution stats
139
         // Get all the unique user ids from the framerate and resolution stats
140
         // and update remote user stats as needed.
140
         // and update remote user stats as needed.
142
         const resolutionUserIds = Object.keys(allUserResolutions);
142
         const resolutionUserIds = Object.keys(allUserResolutions);
143
 
143
 
144
         _.union(framerateUserIds, resolutionUserIds)
144
         _.union(framerateUserIds, resolutionUserIds)
145
-            .filter(id => id !== currentUserId)
145
+            .filter(id => id !== localUserId)
146
             .forEach(id => {
146
             .forEach(id => {
147
                 const remoteUserStats = {};
147
                 const remoteUserStats = {};
148
 
148
 

+ 72
- 7
react/features/connection-stats/components/ConnectionStatsTable.js View File

33
          */
33
          */
34
         bitrate: PropTypes.object,
34
         bitrate: PropTypes.object,
35
 
35
 
36
+        /**
37
+         * The number of bridges (aka media servers) currently used in the
38
+         * conference.
39
+         */
40
+        bridgeCount: PropTypes.number,
41
+
36
         /**
42
         /**
37
          * A message describing the connection quality.
43
          * A message describing the connection quality.
38
          */
44
          */
71
         packetLoss: PropTypes.object,
77
         packetLoss: PropTypes.object,
72
 
78
 
73
         /**
79
         /**
74
-         * The region.
80
+         * The region that we think the client is in.
75
          */
81
          */
76
         region: PropTypes.string,
82
         region: PropTypes.string,
77
 
83
 
86
          */
92
          */
87
         resolution: PropTypes.object,
93
         resolution: PropTypes.object,
88
 
94
 
95
+        /**
96
+         * The region of the media server that we are connected to.
97
+         */
98
+        serverRegion: PropTypes.string,
99
+
89
         /**
100
         /**
90
          * Whether or not additional stats about bandwidth and transport should
101
          * Whether or not additional stats about bandwidth and transport should
91
          * be displayed. Will not display even if true for remote participants.
102
          * be displayed. Will not display even if true for remote participants.
124
 
135
 
125
     /**
136
     /**
126
      * Creates a table as ReactElement that will display additional statistics
137
      * Creates a table as ReactElement that will display additional statistics
127
-     * related to bandwidth and transport.
138
+     * related to bandwidth and transport for the local user.
128
      *
139
      *
129
      * @private
140
      * @private
130
      * @returns {ReactElement}
141
      * @returns {ReactElement}
135
                 <tbody>
146
                 <tbody>
136
                     { this._renderBandwidth() }
147
                     { this._renderBandwidth() }
137
                     { this._renderTransport() }
148
                     { this._renderTransport() }
149
+                    { this._renderRegion() }
138
                 </tbody>
150
                 </tbody>
139
             </table>
151
             </table>
140
         );
152
         );
226
      * @private
238
      * @private
227
      */
239
      */
228
     _renderE2eRtt() {
240
     _renderE2eRtt() {
229
-        const { e2eRtt, region, t } = this.props;
230
-        let str = e2eRtt ? `${e2eRtt.toFixed(0)}ms` : 'N/A';
241
+        const { e2eRtt, t } = this.props;
242
+        const str = e2eRtt ? `${e2eRtt.toFixed(0)}ms` : 'N/A';
231
 
243
 
232
-        if (region) {
233
-            str += ` (${region})`;
244
+        return (
245
+            <tr>
246
+                <td>
247
+                    <span>{ t('connectionindicator.e2e_rtt') }</span>
248
+                </td>
249
+                <td>{ str }</td>
250
+            </tr>
251
+        );
252
+    }
253
+
254
+    /**
255
+     * Creates a table row as a ReactElement for displaying the "connected to"
256
+     * information.
257
+     *
258
+     * @returns {ReactElement}
259
+     * @private
260
+     */
261
+    _renderRegion() {
262
+        const { region, serverRegion, t } = this.props;
263
+        let str = serverRegion;
264
+
265
+        if (!serverRegion) {
266
+            return;
267
+        }
268
+
269
+
270
+        if (region && serverRegion && region !== serverRegion) {
271
+            str += ` from ${region}`;
234
         }
272
         }
235
 
273
 
236
         return (
274
         return (
237
             <tr>
275
             <tr>
238
                 <td>
276
                 <td>
239
-                    <span>{ t('connectionindicator.e2e_rtt') }</span>
277
+                    <span>{ t('connectionindicator.connectedTo') }</span>
240
                 </td>
278
                 </td>
241
                 <td>{ str }</td>
279
                 <td>{ str }</td>
242
             </tr>
280
             </tr>
243
         );
281
         );
244
     }
282
     }
245
 
283
 
284
+    /**
285
+     * Creates a table row as a ReactElement for displaying the "bridge count"
286
+     * information.
287
+     *
288
+     * @returns {*}
289
+     * @private
290
+     */
291
+    _renderBridgeCount() {
292
+        const { bridgeCount, t } = this.props;
293
+
294
+        // 0 is valid, but undefined/null/NaN aren't.
295
+        if (!bridgeCount && bridgeCount !== 0) {
296
+            return;
297
+        }
298
+
299
+        return (
300
+            <tr>
301
+                <td>
302
+                    <span>{ t('connectionindicator.bridgeCount') }</span>
303
+                </td>
304
+                <td>{ bridgeCount }</td>
305
+            </tr>
306
+        );
307
+    }
308
+
246
     /**
309
     /**
247
      * Creates a table row as a ReactElement for displaying frame rate related
310
      * Creates a table row as a ReactElement for displaying frame rate related
248
      * statistics.
311
      * statistics.
373
                     { this._renderBitrate() }
436
                     { this._renderBitrate() }
374
                     { this._renderPacketLoss() }
437
                     { this._renderPacketLoss() }
375
                     { isRemoteVideo ? this._renderE2eRtt() : null }
438
                     { isRemoteVideo ? this._renderE2eRtt() : null }
439
+                    { isRemoteVideo ? this._renderRegion() : null }
376
                     { this._renderResolution() }
440
                     { this._renderResolution() }
377
                     { this._renderFrameRate() }
441
                     { this._renderFrameRate() }
442
+                    { isRemoteVideo ? null : this._renderBridgeCount() }
378
                 </tbody>
443
                 </tbody>
379
             </table>
444
             </table>
380
         );
445
         );

Loading…
Cancel
Save