@webex/internal-plugin-metrics 3.10.0-next.3 → 3.10.0-wxc-disconnect.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +25 -26
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +1 -5
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +0 -1
- package/package.json +10 -10
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +24 -32
- package/src/call-diagnostic/call-diagnostic-metrics.ts +2 -5
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1 -200
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable class-methods-use-this */
|
|
2
2
|
/* eslint-disable valid-jsdoc */
|
|
3
3
|
import {WebexPlugin} from '@webex/webex-core';
|
|
4
|
-
import {clamp} from 'lodash';
|
|
5
4
|
|
|
6
5
|
import {MetricEventNames, PreComputedLatencies} from '../metrics.types';
|
|
7
6
|
|
|
@@ -17,7 +16,6 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
17
16
|
precomputedLatencies: Map<PreComputedLatencies, number>;
|
|
18
17
|
// meetingId that the current latencies are for
|
|
19
18
|
private meetingId?: string;
|
|
20
|
-
private MAX_INTEGER = 2147483647;
|
|
21
19
|
|
|
22
20
|
/**
|
|
23
21
|
* @constructor
|
|
@@ -164,9 +162,13 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
164
162
|
|
|
165
163
|
const diff = end - start;
|
|
166
164
|
|
|
167
|
-
|
|
165
|
+
if (!clampValues) {
|
|
166
|
+
return diff;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const {minimum = 0, maximum} = clampValues;
|
|
168
170
|
|
|
169
|
-
return
|
|
171
|
+
return Math.min(maximum ?? Infinity, Math.max(diff, minimum));
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
/**
|
|
@@ -316,7 +318,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
316
318
|
public getPageJMT() {
|
|
317
319
|
const latency = this.precomputedLatencies.get('internal.client.pageJMT');
|
|
318
320
|
|
|
319
|
-
return typeof latency === 'number' ?
|
|
321
|
+
return typeof latency === 'number' ? latency : undefined;
|
|
320
322
|
}
|
|
321
323
|
|
|
322
324
|
/**
|
|
@@ -326,7 +328,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
326
328
|
public getDownloadTimeJMT() {
|
|
327
329
|
const latency = this.precomputedLatencies.get('internal.download.time');
|
|
328
330
|
|
|
329
|
-
return typeof latency === 'number' ?
|
|
331
|
+
return typeof latency === 'number' ? latency : undefined;
|
|
330
332
|
}
|
|
331
333
|
|
|
332
334
|
/**
|
|
@@ -347,7 +349,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
347
349
|
);
|
|
348
350
|
|
|
349
351
|
if (typeof clickToInterstitialLatency === 'number') {
|
|
350
|
-
return
|
|
352
|
+
return clickToInterstitialLatency;
|
|
351
353
|
}
|
|
352
354
|
|
|
353
355
|
return undefined;
|
|
@@ -371,7 +373,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
371
373
|
);
|
|
372
374
|
|
|
373
375
|
if (typeof clickToInterstitialWithUserDelayLatency === 'number') {
|
|
374
|
-
return
|
|
376
|
+
return clickToInterstitialWithUserDelayLatency;
|
|
375
377
|
}
|
|
376
378
|
|
|
377
379
|
return undefined;
|
|
@@ -418,7 +420,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
418
420
|
if (interstitialJoinClickTimestamp && connectedMedia) {
|
|
419
421
|
const interstitialToMediaOKJmt = connectedMedia - interstitialJoinClickTimestamp - lobbyTime;
|
|
420
422
|
|
|
421
|
-
return
|
|
423
|
+
return Math.max(0, interstitialToMediaOKJmt);
|
|
422
424
|
}
|
|
423
425
|
|
|
424
426
|
return undefined;
|
|
@@ -433,7 +435,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
433
435
|
const interstitialToJoinOk = this.getInterstitialToJoinOK();
|
|
434
436
|
|
|
435
437
|
if (typeof clickToInterstitial === 'number' && typeof interstitialToJoinOk === 'number') {
|
|
436
|
-
return
|
|
438
|
+
return clickToInterstitial + interstitialToJoinOk;
|
|
437
439
|
}
|
|
438
440
|
|
|
439
441
|
return undefined;
|
|
@@ -451,7 +453,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
451
453
|
typeof clickToInterstitialWithUserDelay === 'number' &&
|
|
452
454
|
typeof interstitialToJoinOk === 'number'
|
|
453
455
|
) {
|
|
454
|
-
return
|
|
456
|
+
return clickToInterstitialWithUserDelay + interstitialToJoinOk;
|
|
455
457
|
}
|
|
456
458
|
|
|
457
459
|
return undefined;
|
|
@@ -466,7 +468,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
466
468
|
const ICESetupTime = this.getICESetupTime();
|
|
467
469
|
|
|
468
470
|
if (joinReqResp && ICESetupTime) {
|
|
469
|
-
return
|
|
471
|
+
return joinReqResp + ICESetupTime;
|
|
470
472
|
}
|
|
471
473
|
|
|
472
474
|
return undefined;
|
|
@@ -483,16 +485,12 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
483
485
|
const lobbyTime = this.getStayLobbyTime();
|
|
484
486
|
|
|
485
487
|
if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {
|
|
486
|
-
const totalMediaJMT =
|
|
487
|
-
clickToInterstitial + interstitialToJoinOk + joinConfJMT,
|
|
488
|
-
0,
|
|
489
|
-
Infinity
|
|
490
|
-
);
|
|
488
|
+
const totalMediaJMT = Math.max(0, clickToInterstitial + interstitialToJoinOk + joinConfJMT);
|
|
491
489
|
if (this.getMeeting()?.allowMediaInLobby) {
|
|
492
|
-
return
|
|
490
|
+
return totalMediaJMT;
|
|
493
491
|
}
|
|
494
492
|
|
|
495
|
-
return
|
|
493
|
+
return Math.max(0, totalMediaJMT - lobbyTime);
|
|
496
494
|
}
|
|
497
495
|
|
|
498
496
|
return undefined;
|
|
@@ -508,11 +506,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
508
506
|
const joinConfJMT = this.getJoinConfJMT();
|
|
509
507
|
|
|
510
508
|
if (clickToInterstitialWithUserDelay && interstitialToJoinOk && joinConfJMT) {
|
|
511
|
-
return
|
|
512
|
-
clickToInterstitialWithUserDelay + interstitialToJoinOk + joinConfJMT,
|
|
513
|
-
0,
|
|
514
|
-
this.MAX_INTEGER
|
|
515
|
-
);
|
|
509
|
+
return Math.max(0, clickToInterstitialWithUserDelay + interstitialToJoinOk + joinConfJMT);
|
|
516
510
|
}
|
|
517
511
|
|
|
518
512
|
return undefined;
|
|
@@ -527,7 +521,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
527
521
|
const joinConfJMT = this.getJoinConfJMT();
|
|
528
522
|
|
|
529
523
|
if (typeof interstitialToJoinOk === 'number' && typeof joinConfJMT === 'number') {
|
|
530
|
-
return
|
|
524
|
+
return Math.max(0, interstitialToJoinOk - joinConfJMT);
|
|
531
525
|
}
|
|
532
526
|
|
|
533
527
|
return undefined;
|
|
@@ -554,7 +548,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
554
548
|
const reachablityClusterReqResp = this.precomputedLatencies.get('internal.get.cluster.time');
|
|
555
549
|
|
|
556
550
|
return typeof reachablityClusterReqResp === 'number'
|
|
557
|
-
?
|
|
551
|
+
? Math.floor(reachablityClusterReqResp)
|
|
558
552
|
: undefined;
|
|
559
553
|
}
|
|
560
554
|
|
|
@@ -588,9 +582,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
588
582
|
public getExchangeCITokenJMT() {
|
|
589
583
|
const exchangeCITokenJMT = this.precomputedLatencies.get('internal.exchange.ci.token.time');
|
|
590
584
|
|
|
591
|
-
return typeof exchangeCITokenJMT === 'number'
|
|
592
|
-
? clamp(Math.floor(exchangeCITokenJMT), 0, this.MAX_INTEGER)
|
|
593
|
-
: undefined;
|
|
585
|
+
return typeof exchangeCITokenJMT === 'number' ? Math.floor(exchangeCITokenJMT) : undefined;
|
|
594
586
|
}
|
|
595
587
|
|
|
596
588
|
/**
|
|
@@ -600,7 +592,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
600
592
|
const refreshCaptchaReqResp = this.precomputedLatencies.get('internal.refresh.captcha.time');
|
|
601
593
|
|
|
602
594
|
return typeof refreshCaptchaReqResp === 'number'
|
|
603
|
-
?
|
|
595
|
+
? Math.floor(refreshCaptchaReqResp)
|
|
604
596
|
: undefined;
|
|
605
597
|
}
|
|
606
598
|
|
|
@@ -614,7 +606,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
614
606
|
);
|
|
615
607
|
|
|
616
608
|
return typeof downloadIntelligenceModelsReqResp === 'number'
|
|
617
|
-
?
|
|
609
|
+
? Math.floor(downloadIntelligenceModelsReqResp)
|
|
618
610
|
: undefined;
|
|
619
611
|
}
|
|
620
612
|
|
|
@@ -626,6 +618,6 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
626
618
|
public getOtherAppApiReqResp() {
|
|
627
619
|
const otherAppApiJMT = this.precomputedLatencies.get('internal.other.app.api.time');
|
|
628
620
|
|
|
629
|
-
return otherAppApiJMT > 0 ?
|
|
621
|
+
return otherAppApiJMT > 0 ? Math.floor(otherAppApiJMT) : undefined;
|
|
630
622
|
}
|
|
631
623
|
}
|
|
@@ -1415,11 +1415,8 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
1415
1415
|
*/
|
|
1416
1416
|
public setDeviceInfo(device: any): void {
|
|
1417
1417
|
// This was created to fix the circular dependency between internal-plugin-device and internal-plugin-metrics
|
|
1418
|
-
this.logger.log('CallDiagnosticMetrics: @setDeviceInfo called',
|
|
1419
|
-
|
|
1420
|
-
deviceId: device?.url,
|
|
1421
|
-
orgId: device?.orgId,
|
|
1422
|
-
});
|
|
1418
|
+
this.logger.log('CallDiagnosticMetrics: @setDeviceInfo called', device);
|
|
1419
|
+
|
|
1423
1420
|
this.device = device;
|
|
1424
1421
|
}
|
|
1425
1422
|
}
|
|
@@ -131,7 +131,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
describe('getDiffBetweenTimestamps with clamping', () => {
|
|
134
|
-
it('should
|
|
134
|
+
it('should return diff without clamping when no clampValues provided', () => {
|
|
135
135
|
cdl.saveTimestamp({key: 'client.alert.displayed', value: 10});
|
|
136
136
|
cdl.saveTimestamp({key: 'client.alert.removed', value: 50});
|
|
137
137
|
const res = cdl.getDiffBetweenTimestamps('client.alert.displayed', 'client.alert.removed');
|
|
@@ -204,20 +204,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
204
204
|
});
|
|
205
205
|
assert.deepEqual(res, undefined);
|
|
206
206
|
});
|
|
207
|
-
|
|
208
|
-
it('should apply default minimum clamping (0) when no clampValues provided and diff is negative', () => {
|
|
209
|
-
cdl.saveTimestamp({key: 'client.alert.displayed', value: 100});
|
|
210
|
-
cdl.saveTimestamp({key: 'client.alert.removed', value: 50});
|
|
211
|
-
const res = cdl.getDiffBetweenTimestamps('client.alert.displayed', 'client.alert.removed');
|
|
212
|
-
assert.deepEqual(res, 0);
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it('should clamp the value when a number greater than 2147483647', () => {
|
|
216
|
-
cdl.saveTimestamp({key: 'client.alert.displayed', value: 0});
|
|
217
|
-
cdl.saveTimestamp({key: 'client.alert.removed', value: 2147483648});
|
|
218
|
-
const res = cdl.getDiffBetweenTimestamps('client.alert.displayed', 'client.alert.removed');
|
|
219
|
-
assert.deepEqual(res, 2147483647);
|
|
220
|
-
});
|
|
221
207
|
});
|
|
222
208
|
|
|
223
209
|
it('calculates getMeetingInfoReqResp correctly', () => {
|
|
@@ -317,12 +303,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
317
303
|
|
|
318
304
|
assert.deepEqual(cdl.getRefreshCaptchaReqResp(), 321);
|
|
319
305
|
});
|
|
320
|
-
|
|
321
|
-
it('returns the correct number when it is greater than 2147483647', () => {
|
|
322
|
-
cdl.saveLatency('internal.refresh.captcha.time', 4294967400);
|
|
323
|
-
|
|
324
|
-
assert.deepEqual(cdl.getRefreshCaptchaReqResp(), 2147483647);
|
|
325
|
-
});
|
|
326
306
|
});
|
|
327
307
|
|
|
328
308
|
describe('getReachabilityClustersReqResp', () => {
|
|
@@ -341,12 +321,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
341
321
|
|
|
342
322
|
assert.deepEqual(cdl.getReachabilityClustersReqResp(), 321);
|
|
343
323
|
});
|
|
344
|
-
|
|
345
|
-
it('returns the correct number when it is greater than 2147483647', () => {
|
|
346
|
-
cdl.saveLatency('internal.get.cluster.time', 4294967400);
|
|
347
|
-
|
|
348
|
-
assert.deepEqual(cdl.getReachabilityClustersReqResp(), 2147483647);
|
|
349
|
-
});
|
|
350
324
|
});
|
|
351
325
|
|
|
352
326
|
describe('getExchangeCITokenJMT', () => {
|
|
@@ -365,12 +339,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
365
339
|
|
|
366
340
|
assert.deepEqual(cdl.getExchangeCITokenJMT(), 321);
|
|
367
341
|
});
|
|
368
|
-
|
|
369
|
-
it('returns the correct number when it is greater than 2147483647', () => {
|
|
370
|
-
cdl.saveLatency('internal.exchange.ci.token.time', 4294967400);
|
|
371
|
-
|
|
372
|
-
assert.deepEqual(cdl.getExchangeCITokenJMT(), 2147483647);
|
|
373
|
-
});
|
|
374
342
|
});
|
|
375
343
|
|
|
376
344
|
describe('saveTimestamp', () => {
|
|
@@ -524,11 +492,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
524
492
|
assert.deepEqual(cdl.getPageJMT(), 10);
|
|
525
493
|
});
|
|
526
494
|
|
|
527
|
-
it('calculates getPageJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
528
|
-
cdl.saveLatency('internal.client.pageJMT', 2147483648);
|
|
529
|
-
assert.deepEqual(cdl.getPageJMT(), 2147483647);
|
|
530
|
-
});
|
|
531
|
-
|
|
532
495
|
it('calculates getClickToInterstitial correctly', () => {
|
|
533
496
|
cdl.saveTimestamp({
|
|
534
497
|
key: 'internal.client.meeting.click.joinbutton',
|
|
@@ -559,11 +522,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
559
522
|
assert.deepEqual(cdl.getClickToInterstitial(), 0);
|
|
560
523
|
});
|
|
561
524
|
|
|
562
|
-
it('calculates getClickToInterstitial without join button timestamp when it is greater than MAX_INTEGER', () => {
|
|
563
|
-
cdl.saveLatency('internal.click.to.interstitial', 2147483648);
|
|
564
|
-
assert.deepEqual(cdl.getClickToInterstitial(), 2147483647);
|
|
565
|
-
});
|
|
566
|
-
|
|
567
525
|
it('calculates getClickToInterstitialWithUserDelay correctly', () => {
|
|
568
526
|
cdl.saveTimestamp({
|
|
569
527
|
key: 'internal.client.meeting.click.joinbutton',
|
|
@@ -594,11 +552,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
594
552
|
assert.deepEqual(cdl.getClickToInterstitialWithUserDelay(), 0);
|
|
595
553
|
});
|
|
596
554
|
|
|
597
|
-
it('calculates getClickToInterstitialWithUserDelay without join button timestamp when it is greater than MAX_INTEGER', () => {
|
|
598
|
-
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 2147483648);
|
|
599
|
-
assert.deepEqual(cdl.getClickToInterstitialWithUserDelay(), 2147483647);
|
|
600
|
-
});
|
|
601
|
-
|
|
602
555
|
it('calculates getInterstitialToJoinOK correctly', () => {
|
|
603
556
|
cdl.saveTimestamp({
|
|
604
557
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
@@ -707,19 +660,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
707
660
|
assert.deepEqual(cdl.getTotalJMT(), undefined);
|
|
708
661
|
});
|
|
709
662
|
|
|
710
|
-
it('calculates getTotalJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
711
|
-
cdl.saveTimestamp({
|
|
712
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
713
|
-
value: 5,
|
|
714
|
-
});
|
|
715
|
-
cdl.saveTimestamp({
|
|
716
|
-
key: 'client.locus.join.response',
|
|
717
|
-
value: 40,
|
|
718
|
-
});
|
|
719
|
-
cdl.saveLatency('internal.click.to.interstitial', 2147483648);
|
|
720
|
-
assert.deepEqual(cdl.getTotalJMT(), 2147483647);
|
|
721
|
-
});
|
|
722
|
-
|
|
723
663
|
it('calculates getTotalJMTWithUserDelay correctly', () => {
|
|
724
664
|
cdl.saveTimestamp({
|
|
725
665
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
@@ -792,19 +732,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
792
732
|
assert.deepEqual(cdl.getTotalJMTWithUserDelay(), undefined);
|
|
793
733
|
});
|
|
794
734
|
|
|
795
|
-
it('calculates getTotalJMTWithUserDelay correctly when it is greater than MAX_INTEGER', () => {
|
|
796
|
-
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 2147483648);
|
|
797
|
-
cdl.saveTimestamp({
|
|
798
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
799
|
-
value: 20,
|
|
800
|
-
});
|
|
801
|
-
cdl.saveTimestamp({
|
|
802
|
-
key: 'client.locus.join.response',
|
|
803
|
-
value: 40,
|
|
804
|
-
});
|
|
805
|
-
assert.deepEqual(cdl.getTotalJMTWithUserDelay(), 2147483647);
|
|
806
|
-
});
|
|
807
|
-
|
|
808
735
|
it('calculates getTotalMediaJMT correctly', () => {
|
|
809
736
|
cdl.saveTimestamp({
|
|
810
737
|
key: 'internal.client.meeting.click.joinbutton',
|
|
@@ -841,42 +768,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
841
768
|
assert.deepEqual(cdl.getTotalMediaJMT(), 27);
|
|
842
769
|
});
|
|
843
770
|
|
|
844
|
-
it('calculates getTotalMediaJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
845
|
-
cdl.saveTimestamp({
|
|
846
|
-
key: 'internal.client.meeting.click.joinbutton',
|
|
847
|
-
value: 5,
|
|
848
|
-
});
|
|
849
|
-
cdl.saveTimestamp({
|
|
850
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
851
|
-
value: 8,
|
|
852
|
-
});
|
|
853
|
-
cdl.saveTimestamp({
|
|
854
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
855
|
-
value: 10,
|
|
856
|
-
});
|
|
857
|
-
cdl.saveTimestamp({
|
|
858
|
-
key: 'client.locus.join.request',
|
|
859
|
-
value: 12,
|
|
860
|
-
});
|
|
861
|
-
cdl.saveTimestamp({
|
|
862
|
-
key: 'client.locus.join.response',
|
|
863
|
-
value: 2147483700,
|
|
864
|
-
});
|
|
865
|
-
cdl.saveTimestamp({
|
|
866
|
-
key: 'internal.host.meeting.participant.admitted',
|
|
867
|
-
value: 2147483800,
|
|
868
|
-
});
|
|
869
|
-
cdl.saveTimestamp({
|
|
870
|
-
key: 'client.ice.start',
|
|
871
|
-
value: 30,
|
|
872
|
-
});
|
|
873
|
-
cdl.saveTimestamp({
|
|
874
|
-
key: 'client.ice.end',
|
|
875
|
-
value: 100,
|
|
876
|
-
});
|
|
877
|
-
assert.deepEqual(cdl.getTotalMediaJMT(), 2147483647);
|
|
878
|
-
});
|
|
879
|
-
|
|
880
771
|
it('calculates getTotalMediaJMT correctly with allowMediaInLobby true', () => {
|
|
881
772
|
cdl.saveTimestamp({
|
|
882
773
|
key: 'internal.client.meeting.click.joinbutton',
|
|
@@ -914,43 +805,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
914
805
|
assert.deepEqual(cdl.getTotalMediaJMT(), 31);
|
|
915
806
|
});
|
|
916
807
|
|
|
917
|
-
it('calculates getTotalMediaJMT correctly with allowMediaInLobby true and it is greater than MAX_INTEGER', () => {
|
|
918
|
-
cdl.saveTimestamp({
|
|
919
|
-
key: 'internal.client.meeting.click.joinbutton',
|
|
920
|
-
value: 5,
|
|
921
|
-
options: {meetingId: 'meeting-id'},
|
|
922
|
-
});
|
|
923
|
-
cdl.saveTimestamp({
|
|
924
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
925
|
-
value: 100,
|
|
926
|
-
});
|
|
927
|
-
cdl.saveTimestamp({
|
|
928
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
929
|
-
value: 1000,
|
|
930
|
-
});
|
|
931
|
-
cdl.saveTimestamp({
|
|
932
|
-
key: 'client.locus.join.request',
|
|
933
|
-
value: 2000,
|
|
934
|
-
});
|
|
935
|
-
cdl.saveTimestamp({
|
|
936
|
-
key: 'client.locus.join.response',
|
|
937
|
-
value: 2147483700,
|
|
938
|
-
});
|
|
939
|
-
cdl.saveTimestamp({
|
|
940
|
-
key: 'internal.host.meeting.participant.admitted',
|
|
941
|
-
value: 2147483800,
|
|
942
|
-
});
|
|
943
|
-
cdl.saveTimestamp({
|
|
944
|
-
key: 'client.ice.start',
|
|
945
|
-
value: 2147483900,
|
|
946
|
-
});
|
|
947
|
-
cdl.saveTimestamp({
|
|
948
|
-
key: 'client.ice.end',
|
|
949
|
-
value: 4294967400,
|
|
950
|
-
});
|
|
951
|
-
assert.deepEqual(cdl.getTotalMediaJMT(), 2147483647);
|
|
952
|
-
});
|
|
953
|
-
|
|
954
808
|
it('calculates getTotalMediaJMTWithUserDelay correctly', () => {
|
|
955
809
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 7);
|
|
956
810
|
cdl.saveTimestamp({
|
|
@@ -1036,28 +890,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
1036
890
|
assert.deepEqual(cdl.getJoinConfJMT(), 20);
|
|
1037
891
|
});
|
|
1038
892
|
|
|
1039
|
-
it('calculates getJoinConfJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
1040
|
-
// Since both getJoinReqResp and getICESetupTime are individually clamped to 1200000,
|
|
1041
|
-
// the maximum possible sum is 2400000, which is less than MAX_INTEGER (2147483647).
|
|
1042
|
-
// This test should verify that the final clamping works by mocking the intermediate methods
|
|
1043
|
-
// to return values that would sum to more than MAX_INTEGER.
|
|
1044
|
-
|
|
1045
|
-
const originalGetJoinReqResp = cdl.getJoinReqResp;
|
|
1046
|
-
const originalGetICESetupTime = cdl.getICESetupTime;
|
|
1047
|
-
|
|
1048
|
-
// Mock the methods to return large values that would exceed MAX_INTEGER when summed
|
|
1049
|
-
cdl.getJoinReqResp = () => 1500000000;
|
|
1050
|
-
cdl.getICESetupTime = () => 1000000000;
|
|
1051
|
-
|
|
1052
|
-
const result = cdl.getJoinConfJMT();
|
|
1053
|
-
|
|
1054
|
-
// Restore original methods
|
|
1055
|
-
cdl.getJoinReqResp = originalGetJoinReqResp;
|
|
1056
|
-
cdl.getICESetupTime = originalGetICESetupTime;
|
|
1057
|
-
|
|
1058
|
-
assert.deepEqual(result, 2147483647);
|
|
1059
|
-
});
|
|
1060
|
-
|
|
1061
893
|
it('calculates getClientJMT correctly', () => {
|
|
1062
894
|
cdl.saveTimestamp({
|
|
1063
895
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
@@ -1150,26 +982,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
1150
982
|
assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 8);
|
|
1151
983
|
});
|
|
1152
984
|
|
|
1153
|
-
it('calculates getInterstitialToMediaOKJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
1154
|
-
cdl.saveTimestamp({
|
|
1155
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
1156
|
-
value: 4,
|
|
1157
|
-
});
|
|
1158
|
-
cdl.saveTimestamp({
|
|
1159
|
-
key: 'client.locus.join.response',
|
|
1160
|
-
value: 10,
|
|
1161
|
-
});
|
|
1162
|
-
cdl.saveTimestamp({
|
|
1163
|
-
key: 'internal.host.meeting.participant.admitted',
|
|
1164
|
-
value: 12,
|
|
1165
|
-
});
|
|
1166
|
-
cdl.saveTimestamp({
|
|
1167
|
-
key: 'client.ice.end',
|
|
1168
|
-
value: 2147483700,
|
|
1169
|
-
});
|
|
1170
|
-
assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 2147483647);
|
|
1171
|
-
});
|
|
1172
|
-
|
|
1173
985
|
it('calculates getInterstitialToMediaOKJMT correctly without lobby', () => {
|
|
1174
986
|
cdl.saveTimestamp({
|
|
1175
987
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
@@ -1217,11 +1029,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
1217
1029
|
assert.deepEqual(cdl.getDownloadTimeJMT(), 1000);
|
|
1218
1030
|
});
|
|
1219
1031
|
|
|
1220
|
-
it('calculates getDownloadTimeJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
1221
|
-
cdl.saveLatency('internal.download.time', 2147483648);
|
|
1222
|
-
assert.deepEqual(cdl.getDownloadTimeJMT(), 2147483647);
|
|
1223
|
-
});
|
|
1224
|
-
|
|
1225
1032
|
describe('getOtherAppApiReqResp', () => {
|
|
1226
1033
|
it('returns undefined when no precomputed value available', () => {
|
|
1227
1034
|
assert.deepEqual(cdl.getOtherAppApiReqResp(), undefined);
|
|
@@ -1244,12 +1051,6 @@ describe('internal-plugin-metrics', () => {
|
|
|
1244
1051
|
|
|
1245
1052
|
assert.deepEqual(cdl.getOtherAppApiReqResp(), 321);
|
|
1246
1053
|
});
|
|
1247
|
-
|
|
1248
|
-
it('returns the correct number when it is greater than 2147483647', () => {
|
|
1249
|
-
cdl.saveLatency('internal.other.app.api.time', 4294967400);
|
|
1250
|
-
|
|
1251
|
-
assert.deepEqual(cdl.getOtherAppApiReqResp(), 2147483647);
|
|
1252
|
-
});
|
|
1253
1054
|
});
|
|
1254
1055
|
});
|
|
1255
1056
|
});
|
|
@@ -3906,7 +3906,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
3906
3906
|
|
|
3907
3907
|
assert.deepEqual(webexLoggerLogCalls[0].args, [
|
|
3908
3908
|
'CallDiagnosticMetrics: @setDeviceInfo called',
|
|
3909
|
-
|
|
3909
|
+
device,
|
|
3910
3910
|
]);
|
|
3911
3911
|
|
|
3912
3912
|
assert.deepEqual(cd.device, device);
|