-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Displays the region participants are connected to #3451
Changes from all commits
d47eb79
0552184
83c9d23
a3be02c
b11b64a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,12 @@ class ConnectionStatsTable extends Component { | |
*/ | ||
bitrate: PropTypes.object, | ||
|
||
/** | ||
* The number of bridges (aka media servers) currently used in the | ||
* conference. | ||
*/ | ||
bridgeCount: PropTypes.number, | ||
|
||
/** | ||
* A message describing the connection quality. | ||
*/ | ||
|
@@ -71,7 +77,7 @@ class ConnectionStatsTable extends Component { | |
packetLoss: PropTypes.object, | ||
|
||
/** | ||
* The region. | ||
* The region that we think the client is in. | ||
*/ | ||
region: PropTypes.string, | ||
|
||
|
@@ -86,6 +92,11 @@ class ConnectionStatsTable extends Component { | |
*/ | ||
resolution: PropTypes.object, | ||
|
||
/** | ||
* The region of the media server that we are connected to. | ||
*/ | ||
serverRegion: PropTypes.string, | ||
|
||
/** | ||
* Whether or not additional stats about bandwidth and transport should | ||
* be displayed. Will not display even if true for remote participants. | ||
|
@@ -124,7 +135,7 @@ class ConnectionStatsTable extends Component { | |
|
||
/** | ||
* Creates a table as ReactElement that will display additional statistics | ||
* related to bandwidth and transport. | ||
* related to bandwidth and transport for the local user. | ||
* | ||
* @private | ||
* @returns {ReactElement} | ||
|
@@ -135,6 +146,7 @@ class ConnectionStatsTable extends Component { | |
<tbody> | ||
{ this._renderBandwidth() } | ||
{ this._renderTransport() } | ||
{ this._renderRegion() } | ||
</tbody> | ||
</table> | ||
); | ||
|
@@ -226,23 +238,74 @@ class ConnectionStatsTable extends Component { | |
* @private | ||
*/ | ||
_renderE2eRtt() { | ||
const { e2eRtt, region, t } = this.props; | ||
let str = e2eRtt ? `${e2eRtt.toFixed(0)}ms` : 'N/A'; | ||
const { e2eRtt, t } = this.props; | ||
const str = e2eRtt ? `${e2eRtt.toFixed(0)}ms` : 'N/A'; | ||
|
||
if (region) { | ||
str += ` (${region})`; | ||
return ( | ||
<tr> | ||
<td> | ||
<span>{ t('connectionindicator.e2e_rtt') }</span> | ||
</td> | ||
<td>{ str }</td> | ||
</tr> | ||
); | ||
} | ||
|
||
/** | ||
* Creates a table row as a ReactElement for displaying the "connected to" | ||
* information. | ||
* | ||
* @returns {ReactElement} | ||
* @private | ||
*/ | ||
_renderRegion() { | ||
const { region, serverRegion, t } = this.props; | ||
let str = serverRegion; | ||
|
||
if (!serverRegion) { | ||
return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you prefer showing N/A over not showing the row? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I decided to hide it because of deployments where regions are not configured. There it would show 'N/A' permanently (while for the rest of the stats it is reasonable to expect that they will appear once we get the data). |
||
} | ||
|
||
|
||
if (region && serverRegion && region !== serverRegion) { | ||
str += ` from ${region}`; | ||
} | ||
|
||
return ( | ||
<tr> | ||
<td> | ||
<span>{ t('connectionindicator.e2e_rtt') }</span> | ||
<span>{ t('connectionindicator.connectedTo') }</span> | ||
</td> | ||
<td>{ str }</td> | ||
</tr> | ||
); | ||
} | ||
|
||
/** | ||
* Creates a table row as a ReactElement for displaying the "bridge count" | ||
* information. | ||
* | ||
* @returns {*} | ||
* @private | ||
*/ | ||
_renderBridgeCount() { | ||
const { bridgeCount, t } = this.props; | ||
|
||
// 0 is valid, but undefined/null/NaN aren't. | ||
if (!bridgeCount && bridgeCount !== 0) { | ||
return; | ||
} | ||
|
||
return ( | ||
<tr> | ||
<td> | ||
<span>{ t('connectionindicator.bridgeCount') }</span> | ||
</td> | ||
<td>{ bridgeCount }</td> | ||
</tr> | ||
); | ||
} | ||
|
||
/** | ||
* Creates a table row as a ReactElement for displaying frame rate related | ||
* statistics. | ||
|
@@ -373,8 +436,10 @@ class ConnectionStatsTable extends Component { | |
{ this._renderBitrate() } | ||
{ this._renderPacketLoss() } | ||
{ isRemoteVideo ? this._renderE2eRtt() : null } | ||
{ isRemoteVideo ? this._renderRegion() : null } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I recall you asking me about this. I think you can also do |
||
{ this._renderResolution() } | ||
{ this._renderFrameRate() } | ||
{ isRemoteVideo ? null : this._renderBridgeCount() } | ||
</tbody> | ||
</table> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dang, maybe at this point, not saying for this PR, ConnectionStatsTable should just take in the stats object itself or we use a spread operator to pass in all stat values (
{ ...this.state.stats }
)or have ConnectionStatsTable listen instead of just ConnectionIndicator.