Skip to content
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

fix: send rtc metrics at the beginning every 5 seconds #3893

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

k-wasniowski
Copy link
Contributor

… seconds

COMPLETES #< INSERT LINK TO ISSUE >

This pull request addresses

< DESCRIBE THE CONTEXT OF THE ISSUE >

by making the following changes

< DESCRIBE YOUR CHANGES >

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

@k-wasniowski k-wasniowski force-pushed the fix-send-rtc-metrics-every-5-seconds-at-the-beginning branch from 52f0ecb to 8b71ce3 Compare October 9, 2024 08:25
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3893.d3m3l2kee0btzx.amplifyapp.com

@@ -151,7 +152,7 @@ export default class RtcMetrics {
*/
private resetConnection() {
this.connectionId = uuid.v4();
this.shouldSendMetricsOnNextStatsReport = true;
this.shouldSendMetricsOnNextStatsReport = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should set this to 30000/5000 here too, right? This is called from constructor so this is the default used when we join the meeting straight in, without lobby.

@@ -3213,7 +3213,8 @@ export default class Meeting extends StatelessWebexPlugin {
options: {meetingId: this.id},
});
}
this.rtcMetrics?.sendNextMetrics();
const numberOfReportsToSend = 30000 / 5000; // 30 seconds divided by 5 seconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's really annoying that the constant for calling getStats every 5s is buried deep in WCME and not even exported from it, but at least the 30s timer for uploading is defined in rtcMetrics/index.ts in SDK so we could define a constant and use it here instead of hardcoding 30000. Maybe define a constant for the 5s inside rtcMetrics/index.ts too so that both are kept together? Or don't bother with the math and just set numberOfReportsToSend=5 or 6, after all we just want "a few" reports with data from initial meeting phase, don't care about the exact number of seconds the data is from. If you go with that, then maybe define a constant so the same value is used also when we don't go through lobby (see my other comment)

@@ -95,7 +96,7 @@ export default class RtcMetrics {
// this is the first useful set of data (WCME gives it to us after 5s), send it out immediately
// in case the user is unhappy and closes the browser early
this.sendMetricsInQueue();
this.shouldSendMetricsOnNextStatsReport = false;
this.shouldSendMetricsOnNextStatsReport -= 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe worth changing the condition in line 95 to this.shouldSendMetricsOnNextStatsReport > 0 just in case if that variable ever became negative somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants