Skip to content

Commit

Permalink
fix: adjust the meaning of logUploadIntervalMultiplicationFactor (#4034)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-bazyl authored Dec 20, 2024
1 parent 82b8178 commit 0b897d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
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

0 comments on commit 0b897d0

Please sign in to comment.