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: adjust the meaning of logUploadIntervalMultiplicationFactor #4034

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@webex/plugin-meetings/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ export default {
iceCandidatesGatheringTimeout: undefined,
backendIpv6NativeSupport: false,
reachabilityGetClusterTimeout: 5000,
logUploadIntervalMultiplicationFactor: 0, // if set to 0 or undefined, logs won't be uploaded periodically
logUploadIntervalMultiplicationFactor: 0, // if set to 0 or undefined, logs won't be uploaded periodically, if you want periodic logs, recommended value is 1
},
};
3 changes: 2 additions & 1 deletion packages/@webex/plugin-meetings/src/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4099,10 +4099,11 @@ export default class Meeting extends StatelessWebexPlugin {
*/
private setLogUploadTimer() {
// start with short timeouts and increase them later on so in case users have very long multi-hour meetings we don't get too fragmented logs
const LOG_UPLOAD_INTERVALS = [0.1, 1, 15, 15, 30, 30, 30, 60];
const LOG_UPLOAD_INTERVALS = [0.1, 15, 30, 60]; // in minutes

const delay =
1000 *
60 *
// @ts-ignore - config coming from registerPlugin
this.config.logUploadIntervalMultiplicationFactor *
LOG_UPLOAD_INTERVALS[this.logUploadIntervalIndex];
Expand Down
30 changes: 14 additions & 16 deletions packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2492,32 +2492,30 @@ describe('plugin-meetings', () => {
mediaSettings: {},
});

const checkLogCounter = (delay, expectedCounter) => {
const checkLogCounter = (delayInMinutes, expectedCounter) => {
const delayInMilliseconds = delayInMinutes * 60 * 1000;

// first check that the counter is not increased just before the delay
clock.tick(delay - 50);
clock.tick(delayInMilliseconds - 50);
assert.equal(logUploadCounter, expectedCounter - 1);

// and now check that it has reached expected value after the delay
clock.tick(50);
assert.equal(logUploadCounter, expectedCounter);
};

checkLogCounter(100, 1);
checkLogCounter(1000, 2);
checkLogCounter(15000, 3);
checkLogCounter(15000, 4);
checkLogCounter(30000, 5);
checkLogCounter(30000, 6);
checkLogCounter(30000, 7);
checkLogCounter(60000, 8);
checkLogCounter(60000, 9);
checkLogCounter(60000, 10);

// simulate media connection being removed -> no more log uploads should happen
checkLogCounter(0.1, 1);
checkLogCounter(15, 2);
checkLogCounter(30, 3);
checkLogCounter(60, 4);
checkLogCounter(60, 5);

// simulate media connection being removed -> 1 more upload should happen, but nothing more afterwards
meeting.mediaProperties.webrtcMediaConnection = undefined;
checkLogCounter(60, 6);

clock.tick(60000);
assert.equal(logUploadCounter, 11);
clock.tick(120*1000*60);
assert.equal(logUploadCounter, 6);

clock.restore();
});
Expand Down
Loading