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,7 +207,9 @@
207 207
     "connectionindicator":
208 208
     {
209 209
         "header": "Connection data",
210
+        "connectedTo": "Connected to:",
210 211
         "bitrate": "Bitrate:",
212
+        "bridgeCount": "Server count: ",
211 213
         "packetloss": "Packet loss:",
212 214
         "resolution": "Resolution:",
213 215
         "framerate": "Frame rate:",

+ 14
- 8
package-lock.json View File

@@ -9318,8 +9318,8 @@
9318 9318
       }
9319 9319
     },
9320 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 9323
       "requires": {
9324 9324
         "@jitsi/sdp-interop": "0.1.13",
9325 9325
         "@jitsi/sdp-simulcast": "0.2.1",
@@ -9327,6 +9327,7 @@
9327 9327
         "current-executing-script": "0.1.3",
9328 9328
         "jitsi-meet-logger": "github:jitsi/jitsi-meet-logger#6fff754a77a56ab52499f3559105a15886942a1e",
9329 9329
         "js-utils": "github:jitsi/js-utils#d4b78721b754a15c2588b7b0c621a9fff6fa1363",
9330
+        "lodash.isequal": "4.5.0",
9330 9331
         "react-native-callstats": "3.53.4",
9331 9332
         "sdp-transform": "2.3.0",
9332 9333
         "strophe.js": "1.2.15",
@@ -9410,6 +9411,11 @@
9410 9411
       "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=",
9411 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 9419
     "lodash.memoize": {
9414 9420
       "version": "4.1.2",
9415 9421
       "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
@@ -12879,9 +12885,9 @@
12879 12885
       "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw=="
12880 12886
     },
12881 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 12891
       "requires": {
12886 12892
         "sdp": "^2.6.0"
12887 12893
       }
@@ -13940,9 +13946,9 @@
13940 13946
       }
13941 13947
     },
13942 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 13953
     "sdp-transform": {
13948 13954
       "version": "2.3.0",

+ 1
- 1
package.json View File

@@ -49,7 +49,7 @@
49 49
     "jsc-android": "224109.1.0",
50 50
     "jsrsasign": "8.0.12",
51 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 53
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
54 54
     "lodash": "4.17.4",
55 55
     "moment": "2.19.4",

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

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

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

@@ -116,25 +116,25 @@ const statsEmitter = {
116 116
      * also update listeners of remote user stats of changes related to their
117 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 120
      * @param {Object} stats - Connection stats for the local user as provided
121 121
      * by the library.
122 122
      * @returns {void}
123 123
      */
124
-    _onStatsUpdated(currentUserId: string, stats: Object) {
124
+    _onStatsUpdated(localUserId: string, stats: Object) {
125 125
         const allUserFramerates = stats.framerate || {};
126 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 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 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 139
         // Get all the unique user ids from the framerate and resolution stats
140 140
         // and update remote user stats as needed.
@@ -142,7 +142,7 @@ const statsEmitter = {
142 142
         const resolutionUserIds = Object.keys(allUserResolutions);
143 143
 
144 144
         _.union(framerateUserIds, resolutionUserIds)
145
-            .filter(id => id !== currentUserId)
145
+            .filter(id => id !== localUserId)
146 146
             .forEach(id => {
147 147
                 const remoteUserStats = {};
148 148
 

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

@@ -33,6 +33,12 @@ class ConnectionStatsTable extends Component {
33 33
          */
34 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 43
          * A message describing the connection quality.
38 44
          */
@@ -71,7 +77,7 @@ class ConnectionStatsTable extends Component {
71 77
         packetLoss: PropTypes.object,
72 78
 
73 79
         /**
74
-         * The region.
80
+         * The region that we think the client is in.
75 81
          */
76 82
         region: PropTypes.string,
77 83
 
@@ -86,6 +92,11 @@ class ConnectionStatsTable extends Component {
86 92
          */
87 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 101
          * Whether or not additional stats about bandwidth and transport should
91 102
          * be displayed. Will not display even if true for remote participants.
@@ -124,7 +135,7 @@ class ConnectionStatsTable extends Component {
124 135
 
125 136
     /**
126 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 140
      * @private
130 141
      * @returns {ReactElement}
@@ -135,6 +146,7 @@ class ConnectionStatsTable extends Component {
135 146
                 <tbody>
136 147
                     { this._renderBandwidth() }
137 148
                     { this._renderTransport() }
149
+                    { this._renderRegion() }
138 150
                 </tbody>
139 151
             </table>
140 152
         );
@@ -226,23 +238,74 @@ class ConnectionStatsTable extends Component {
226 238
      * @private
227 239
      */
228 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 274
         return (
237 275
             <tr>
238 276
                 <td>
239
-                    <span>{ t('connectionindicator.e2e_rtt') }</span>
277
+                    <span>{ t('connectionindicator.connectedTo') }</span>
240 278
                 </td>
241 279
                 <td>{ str }</td>
242 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 310
      * Creates a table row as a ReactElement for displaying frame rate related
248 311
      * statistics.
@@ -373,8 +436,10 @@ class ConnectionStatsTable extends Component {
373 436
                     { this._renderBitrate() }
374 437
                     { this._renderPacketLoss() }
375 438
                     { isRemoteVideo ? this._renderE2eRtt() : null }
439
+                    { isRemoteVideo ? this._renderRegion() : null }
376 440
                     { this._renderResolution() }
377 441
                     { this._renderFrameRate() }
442
+                    { isRemoteVideo ? null : this._renderBridgeCount() }
378 443
                 </tbody>
379 444
             </table>
380 445
         );

Loading…
Cancel
Save