@webex/internal-plugin-metrics 3.7.0-web-workers-keepalive.1 → 3.7.0-wxcc.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 +19 -14
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +47 -5
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/config.js +2 -1
- package/dist/call-diagnostic/config.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/metrics.types.js.map +1 -1
- package/dist/new-metrics.js +22 -1
- package/dist/new-metrics.js.map +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +8 -1
- package/dist/types/metrics.types.d.ts +5 -0
- package/dist/types/new-metrics.d.ts +11 -0
- package/package.json +11 -11
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +30 -13
- package/src/call-diagnostic/call-diagnostic-metrics.ts +62 -1
- package/src/call-diagnostic/config.ts +1 -0
- package/src/metrics.types.ts +6 -0
- package/src/new-metrics.ts +27 -1
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +73 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +183 -0
- package/test/unit/spec/new-metrics.ts +21 -0
|
@@ -437,6 +437,15 @@ describe('internal-plugin-metrics', () => {
|
|
|
437
437
|
assert.deepEqual(cdl.getClickToInterstitial(), 5);
|
|
438
438
|
});
|
|
439
439
|
|
|
440
|
+
it('calculates getClickToInterstitial without join button timestamp when it is 0', () => {
|
|
441
|
+
cdl.saveLatency('internal.click.to.interstitial', 0);
|
|
442
|
+
cdl.saveTimestamp({
|
|
443
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
444
|
+
value: 20,
|
|
445
|
+
});
|
|
446
|
+
assert.deepEqual(cdl.getClickToInterstitial(), 0);
|
|
447
|
+
});
|
|
448
|
+
|
|
440
449
|
it('calculates getInterstitialToJoinOK correctly', () => {
|
|
441
450
|
cdl.saveTimestamp({
|
|
442
451
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
@@ -449,6 +458,18 @@ describe('internal-plugin-metrics', () => {
|
|
|
449
458
|
assert.deepEqual(cdl.getInterstitialToJoinOK(), 10);
|
|
450
459
|
});
|
|
451
460
|
|
|
461
|
+
it('calculates getInterstitialToJoinOK correctly when one value is not a number', () => {
|
|
462
|
+
cdl.saveTimestamp({
|
|
463
|
+
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
464
|
+
value: 'ten' as unknown as number,
|
|
465
|
+
});
|
|
466
|
+
cdl.saveTimestamp({
|
|
467
|
+
key: 'client.locus.join.response',
|
|
468
|
+
value: 20,
|
|
469
|
+
});
|
|
470
|
+
assert.deepEqual(cdl.getInterstitialToJoinOK(), undefined);
|
|
471
|
+
});
|
|
472
|
+
|
|
452
473
|
it('calculates getCallInitMediaEngineReady correctly', () => {
|
|
453
474
|
cdl.saveTimestamp({
|
|
454
475
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
@@ -481,6 +502,58 @@ describe('internal-plugin-metrics', () => {
|
|
|
481
502
|
assert.deepEqual(cdl.getTotalJMT(), 45);
|
|
482
503
|
});
|
|
483
504
|
|
|
505
|
+
it('calculates getTotalJMT correctly when clickToInterstitial is 0', () => {
|
|
506
|
+
cdl.saveLatency('internal.click.to.interstitial', 0);
|
|
507
|
+
cdl.saveTimestamp({
|
|
508
|
+
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
509
|
+
value: 20,
|
|
510
|
+
});
|
|
511
|
+
cdl.saveTimestamp({
|
|
512
|
+
key: 'client.locus.join.response',
|
|
513
|
+
value: 40,
|
|
514
|
+
});
|
|
515
|
+
assert.deepEqual(cdl.getTotalJMT(), 20);
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
it('calculates getTotalJMT correctly when interstitialToJoinOk is 0', () => {
|
|
519
|
+
cdl.saveTimestamp({
|
|
520
|
+
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
521
|
+
value: 40,
|
|
522
|
+
});
|
|
523
|
+
cdl.saveLatency('internal.click.to.interstitial', 12);
|
|
524
|
+
cdl.saveTimestamp({
|
|
525
|
+
key: 'client.locus.join.response',
|
|
526
|
+
value: 40,
|
|
527
|
+
});
|
|
528
|
+
assert.deepEqual(cdl.getTotalJMT(), 12);
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
it('calculates getTotalJMT correctly when both clickToInterstitial and interstitialToJoinOk are 0', () => {
|
|
532
|
+
cdl.saveTimestamp({
|
|
533
|
+
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
534
|
+
value: 40,
|
|
535
|
+
});
|
|
536
|
+
cdl.saveLatency('internal.click.to.interstitial', 0);
|
|
537
|
+
cdl.saveTimestamp({
|
|
538
|
+
key: 'client.locus.join.response',
|
|
539
|
+
value: 40,
|
|
540
|
+
});
|
|
541
|
+
assert.deepEqual(cdl.getTotalJMT(), 0);
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
it('calculates getTotalJMT correctly when both clickToInterstitial is not a number', () => {
|
|
545
|
+
cdl.saveTimestamp({
|
|
546
|
+
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
547
|
+
value: 40,
|
|
548
|
+
});
|
|
549
|
+
cdl.saveLatency('internal.click.to.interstitial', 'eleven' as unknown as number);
|
|
550
|
+
cdl.saveTimestamp({
|
|
551
|
+
key: 'client.locus.join.response',
|
|
552
|
+
value: 40,
|
|
553
|
+
});
|
|
554
|
+
assert.deepEqual(cdl.getTotalJMT(), undefined);
|
|
555
|
+
});
|
|
556
|
+
|
|
484
557
|
it('calculates getTotalMediaJMT correctly', () => {
|
|
485
558
|
cdl.saveTimestamp({
|
|
486
559
|
key: 'internal.client.meeting.click.joinbutton',
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
} from '@webex/internal-plugin-metrics';
|
|
14
14
|
import uuid from 'uuid';
|
|
15
15
|
import {omit} from 'lodash';
|
|
16
|
+
import { glob } from 'glob';
|
|
17
|
+
import { expect } from 'chai';
|
|
16
18
|
|
|
17
19
|
//@ts-ignore
|
|
18
20
|
global.window = {location: {hostname: 'whatever'}};
|
|
@@ -842,6 +844,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
842
844
|
userType: 'host',
|
|
843
845
|
isConvergedArchitectureEnabled: undefined,
|
|
844
846
|
webexSubServiceType: undefined,
|
|
847
|
+
webClientPreload: undefined,
|
|
845
848
|
},
|
|
846
849
|
options
|
|
847
850
|
);
|
|
@@ -867,6 +870,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
867
870
|
userType: 'host',
|
|
868
871
|
isConvergedArchitectureEnabled: undefined,
|
|
869
872
|
webexSubServiceType: undefined,
|
|
873
|
+
webClientPreload: undefined,
|
|
870
874
|
},
|
|
871
875
|
eventId: 'my-fake-id',
|
|
872
876
|
origin: {
|
|
@@ -903,6 +907,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
903
907
|
userType: 'host',
|
|
904
908
|
isConvergedArchitectureEnabled: undefined,
|
|
905
909
|
webexSubServiceType: undefined,
|
|
910
|
+
webClientPreload: undefined,
|
|
906
911
|
},
|
|
907
912
|
eventId: 'my-fake-id',
|
|
908
913
|
origin: {
|
|
@@ -976,6 +981,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
976
981
|
userType: 'host',
|
|
977
982
|
isConvergedArchitectureEnabled: undefined,
|
|
978
983
|
webexSubServiceType: undefined,
|
|
984
|
+
webClientPreload: undefined,
|
|
979
985
|
},
|
|
980
986
|
options
|
|
981
987
|
);
|
|
@@ -1002,6 +1008,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1002
1008
|
userType: 'host',
|
|
1003
1009
|
isConvergedArchitectureEnabled: undefined,
|
|
1004
1010
|
webexSubServiceType: undefined,
|
|
1011
|
+
webClientPreload: undefined,
|
|
1005
1012
|
},
|
|
1006
1013
|
eventId: 'my-fake-id',
|
|
1007
1014
|
origin: {
|
|
@@ -1039,6 +1046,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1039
1046
|
userType: 'host',
|
|
1040
1047
|
isConvergedArchitectureEnabled: undefined,
|
|
1041
1048
|
webexSubServiceType: undefined,
|
|
1049
|
+
webClientPreload: undefined,
|
|
1042
1050
|
},
|
|
1043
1051
|
eventId: 'my-fake-id',
|
|
1044
1052
|
origin: {
|
|
@@ -1156,6 +1164,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1156
1164
|
},
|
|
1157
1165
|
loginType: 'login-ci',
|
|
1158
1166
|
name: 'client.alert.displayed',
|
|
1167
|
+
webClientPreload: undefined
|
|
1159
1168
|
},
|
|
1160
1169
|
options
|
|
1161
1170
|
);
|
|
@@ -1177,6 +1186,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1177
1186
|
},
|
|
1178
1187
|
loginType: 'login-ci',
|
|
1179
1188
|
name: 'client.alert.displayed',
|
|
1189
|
+
webClientPreload: undefined
|
|
1180
1190
|
},
|
|
1181
1191
|
eventId: 'my-fake-id',
|
|
1182
1192
|
origin: {
|
|
@@ -1250,6 +1260,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1250
1260
|
},
|
|
1251
1261
|
loginType: 'login-ci',
|
|
1252
1262
|
name: 'client.alert.displayed',
|
|
1263
|
+
webClientPreload: undefined,
|
|
1253
1264
|
},
|
|
1254
1265
|
options
|
|
1255
1266
|
);
|
|
@@ -1277,6 +1288,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1277
1288
|
},
|
|
1278
1289
|
eventData: {webClientDomain: 'whatever'},
|
|
1279
1290
|
loginType: 'login-ci',
|
|
1291
|
+
webClientPreload: undefined,
|
|
1280
1292
|
},
|
|
1281
1293
|
},
|
|
1282
1294
|
options.preLoginId
|
|
@@ -1319,6 +1331,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1319
1331
|
joinFlowVersion: 'Other',
|
|
1320
1332
|
isConvergedArchitectureEnabled: undefined,
|
|
1321
1333
|
webexSubServiceType: undefined,
|
|
1334
|
+
webClientPreload: undefined,
|
|
1322
1335
|
},
|
|
1323
1336
|
eventId: 'my-fake-id',
|
|
1324
1337
|
origin: {
|
|
@@ -1371,6 +1384,84 @@ describe('internal-plugin-metrics', () => {
|
|
|
1371
1384
|
joinFlowVersion: 'Other',
|
|
1372
1385
|
isConvergedArchitectureEnabled: undefined,
|
|
1373
1386
|
webexSubServiceType: undefined,
|
|
1387
|
+
webClientPreload: undefined,
|
|
1388
|
+
},
|
|
1389
|
+
eventId: 'my-fake-id',
|
|
1390
|
+
origin: {
|
|
1391
|
+
origin: 'fake-origin',
|
|
1392
|
+
},
|
|
1393
|
+
originTime: {
|
|
1394
|
+
sent: 'not_defined_yet',
|
|
1395
|
+
triggered: now.toISOString(),
|
|
1396
|
+
},
|
|
1397
|
+
senderCountryCode: 'UK',
|
|
1398
|
+
version: 1,
|
|
1399
|
+
});
|
|
1400
|
+
});
|
|
1401
|
+
|
|
1402
|
+
it('should submit client event successfully with webClientPreload', () => {
|
|
1403
|
+
const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
|
|
1404
|
+
const submitToCallDiagnosticsSpy = sinon.spy(cd, 'submitToCallDiagnostics');
|
|
1405
|
+
const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
|
|
1406
|
+
sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
|
|
1407
|
+
|
|
1408
|
+
webex.meetings.config.metrics.webClientPreload = true;
|
|
1409
|
+
|
|
1410
|
+
const options = {
|
|
1411
|
+
correlationId: 'correlationId',
|
|
1412
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1413
|
+
globalMeetingId: 'globalMeetingId1',
|
|
1414
|
+
sessionCorrelationId: 'sessionCorrelationId1',
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
cd.submitClientEvent({
|
|
1418
|
+
name: 'client.alert.displayed',
|
|
1419
|
+
options,
|
|
1420
|
+
});
|
|
1421
|
+
|
|
1422
|
+
assert.notCalled(generateClientEventErrorPayloadSpy);
|
|
1423
|
+
assert.calledWith(
|
|
1424
|
+
prepareDiagnosticEventSpy,
|
|
1425
|
+
{
|
|
1426
|
+
canProceed: true,
|
|
1427
|
+
eventData: {
|
|
1428
|
+
webClientDomain: 'whatever',
|
|
1429
|
+
},
|
|
1430
|
+
identifiers: {
|
|
1431
|
+
correlationId: 'correlationId',
|
|
1432
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1433
|
+
sessionCorrelationId: 'sessionCorrelationId1',
|
|
1434
|
+
globalMeetingId: 'globalMeetingId1',
|
|
1435
|
+
deviceId: 'deviceUrl',
|
|
1436
|
+
locusUrl: 'locus-url',
|
|
1437
|
+
orgId: 'orgId',
|
|
1438
|
+
userId: 'userId',
|
|
1439
|
+
},
|
|
1440
|
+
loginType: 'login-ci',
|
|
1441
|
+
name: 'client.alert.displayed',
|
|
1442
|
+
webClientPreload: true,
|
|
1443
|
+
},
|
|
1444
|
+
options
|
|
1445
|
+
);
|
|
1446
|
+
assert.calledWith(submitToCallDiagnosticsSpy, {
|
|
1447
|
+
event: {
|
|
1448
|
+
canProceed: true,
|
|
1449
|
+
eventData: {
|
|
1450
|
+
webClientDomain: 'whatever',
|
|
1451
|
+
},
|
|
1452
|
+
identifiers: {
|
|
1453
|
+
correlationId: 'correlationId',
|
|
1454
|
+
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1455
|
+
sessionCorrelationId: 'sessionCorrelationId1',
|
|
1456
|
+
globalMeetingId: 'globalMeetingId1',
|
|
1457
|
+
deviceId: 'deviceUrl',
|
|
1458
|
+
locusUrl: 'locus-url',
|
|
1459
|
+
orgId: 'orgId',
|
|
1460
|
+
userId: 'userId',
|
|
1461
|
+
},
|
|
1462
|
+
loginType: 'login-ci',
|
|
1463
|
+
name: 'client.alert.displayed',
|
|
1464
|
+
webClientPreload: true,
|
|
1374
1465
|
},
|
|
1375
1466
|
eventId: 'my-fake-id',
|
|
1376
1467
|
origin: {
|
|
@@ -1442,6 +1533,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1442
1533
|
userType: 'host',
|
|
1443
1534
|
isConvergedArchitectureEnabled: undefined,
|
|
1444
1535
|
webexSubServiceType: undefined,
|
|
1536
|
+
webClientPreload: undefined,
|
|
1445
1537
|
},
|
|
1446
1538
|
eventId: 'my-fake-id',
|
|
1447
1539
|
origin: {
|
|
@@ -1521,6 +1613,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1521
1613
|
userType: 'host',
|
|
1522
1614
|
isConvergedArchitectureEnabled: undefined,
|
|
1523
1615
|
webexSubServiceType: undefined,
|
|
1616
|
+
webClientPreload: undefined,
|
|
1524
1617
|
},
|
|
1525
1618
|
eventId: 'my-fake-id',
|
|
1526
1619
|
origin: {
|
|
@@ -1592,6 +1685,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1592
1685
|
],
|
|
1593
1686
|
loginType: 'login-ci',
|
|
1594
1687
|
name: 'client.alert.displayed',
|
|
1688
|
+
webClientPreload: undefined,
|
|
1595
1689
|
},
|
|
1596
1690
|
eventId: 'my-fake-id',
|
|
1597
1691
|
origin: {
|
|
@@ -1665,6 +1759,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1665
1759
|
],
|
|
1666
1760
|
loginType: 'login-ci',
|
|
1667
1761
|
name: 'client.alert.displayed',
|
|
1762
|
+
webClientPreload: undefined,
|
|
1668
1763
|
},
|
|
1669
1764
|
eventId: 'my-fake-id',
|
|
1670
1765
|
origin: {
|
|
@@ -1747,6 +1842,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1747
1842
|
userType: 'host',
|
|
1748
1843
|
isConvergedArchitectureEnabled: undefined,
|
|
1749
1844
|
webexSubServiceType: undefined,
|
|
1845
|
+
webClientPreload: undefined,
|
|
1750
1846
|
},
|
|
1751
1847
|
eventId: 'my-fake-id',
|
|
1752
1848
|
origin: {
|
|
@@ -2672,10 +2768,21 @@ describe('internal-plugin-metrics', () => {
|
|
|
2672
2768
|
webexScheduled: true,
|
|
2673
2769
|
pmr: false,
|
|
2674
2770
|
enableEvent: true,
|
|
2771
|
+
isConvergedWebinar: true,
|
|
2675
2772
|
};
|
|
2676
2773
|
assert.deepEqual(cd.getSubServiceType(fakeMeeting), 'Webinar');
|
|
2677
2774
|
});
|
|
2678
2775
|
|
|
2776
|
+
it('returns subServicetype as Webcast when meeting is Webinar and enable webcast', () => {
|
|
2777
|
+
fakeMeeting.meetingInfo = {
|
|
2778
|
+
webexScheduled: true,
|
|
2779
|
+
pmr: false,
|
|
2780
|
+
enableEvent: true,
|
|
2781
|
+
isConvergedWebinarWebcast: true,
|
|
2782
|
+
};
|
|
2783
|
+
assert.deepEqual(cd.getSubServiceType(fakeMeeting), 'Webcast');
|
|
2784
|
+
});
|
|
2785
|
+
|
|
2679
2786
|
it('returns subServicetype as undefined when correct parameters are not found', () => {
|
|
2680
2787
|
fakeMeeting.meetingInfo = {};
|
|
2681
2788
|
assert.deepEqual(cd.getSubServiceType(fakeMeeting), undefined);
|
|
@@ -2739,6 +2846,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2739
2846
|
userType: 'host',
|
|
2740
2847
|
isConvergedArchitectureEnabled: undefined,
|
|
2741
2848
|
webexSubServiceType: undefined,
|
|
2849
|
+
webClientPreload: undefined,
|
|
2742
2850
|
},
|
|
2743
2851
|
eventId: 'my-fake-id',
|
|
2744
2852
|
origin: {
|
|
@@ -2938,5 +3046,80 @@ describe('internal-plugin-metrics', () => {
|
|
|
2938
3046
|
assert.deepEqual(cd.device, device);
|
|
2939
3047
|
});
|
|
2940
3048
|
});
|
|
3049
|
+
|
|
3050
|
+
describe('#submitDelayedClientEvents', () => {
|
|
3051
|
+
it('does not call submitClientEvent if there were no delayed events', () => {
|
|
3052
|
+
const submitClientEventSpy = sinon.spy(cd, 'submitClientEvent');
|
|
3053
|
+
|
|
3054
|
+
cd.submitDelayedClientEvents();
|
|
3055
|
+
|
|
3056
|
+
assert.notCalled(submitClientEventSpy);
|
|
3057
|
+
});
|
|
3058
|
+
|
|
3059
|
+
it('calls submitClientEvent for every delayed event and clears delayedClientEvents array', () => {
|
|
3060
|
+
const submitClientEventSpy = sinon.spy(cd, 'submitClientEvent');
|
|
3061
|
+
const submitToCallDiagnosticsSpy = sinon.spy(cd, 'submitToCallDiagnostics');
|
|
3062
|
+
|
|
3063
|
+
const options = {
|
|
3064
|
+
correlationId: 'correlationId',
|
|
3065
|
+
};
|
|
3066
|
+
|
|
3067
|
+
cd.submitClientEvent({
|
|
3068
|
+
name: 'client.alert.displayed',
|
|
3069
|
+
options,
|
|
3070
|
+
delaySubmitEvent: true,
|
|
3071
|
+
});
|
|
3072
|
+
|
|
3073
|
+
cd.submitClientEvent({
|
|
3074
|
+
name: 'client.alert.removed',
|
|
3075
|
+
options,
|
|
3076
|
+
delaySubmitEvent: true,
|
|
3077
|
+
});
|
|
3078
|
+
|
|
3079
|
+
cd.submitClientEvent({
|
|
3080
|
+
name: 'client.call.aborted',
|
|
3081
|
+
options,
|
|
3082
|
+
delaySubmitEvent: true,
|
|
3083
|
+
});
|
|
3084
|
+
|
|
3085
|
+
assert.notCalled(submitToCallDiagnosticsSpy);
|
|
3086
|
+
assert.calledThrice(submitClientEventSpy);
|
|
3087
|
+
submitClientEventSpy.resetHistory();
|
|
3088
|
+
|
|
3089
|
+
cd.submitDelayedClientEvents();
|
|
3090
|
+
|
|
3091
|
+
assert.calledThrice(submitClientEventSpy);
|
|
3092
|
+
assert.calledWith(submitClientEventSpy.firstCall, {
|
|
3093
|
+
name: 'client.alert.displayed',
|
|
3094
|
+
payload: undefined,
|
|
3095
|
+
options: {
|
|
3096
|
+
correlationId: 'correlationId',
|
|
3097
|
+
triggeredTime: now.toISOString(),
|
|
3098
|
+
},
|
|
3099
|
+
});
|
|
3100
|
+
assert.calledWith(submitClientEventSpy.secondCall, {
|
|
3101
|
+
name: 'client.alert.removed',
|
|
3102
|
+
payload: undefined,
|
|
3103
|
+
options: {
|
|
3104
|
+
correlationId: 'correlationId',
|
|
3105
|
+
triggeredTime: now.toISOString(),
|
|
3106
|
+
},
|
|
3107
|
+
});
|
|
3108
|
+
assert.calledWith(submitClientEventSpy.thirdCall, {
|
|
3109
|
+
name: 'client.call.aborted',
|
|
3110
|
+
payload: undefined,
|
|
3111
|
+
options: {
|
|
3112
|
+
correlationId: 'correlationId',
|
|
3113
|
+
triggeredTime: now.toISOString(),
|
|
3114
|
+
},
|
|
3115
|
+
});
|
|
3116
|
+
submitClientEventSpy.resetHistory();
|
|
3117
|
+
|
|
3118
|
+
cd.submitDelayedClientEvents();
|
|
3119
|
+
|
|
3120
|
+
// should not call submitClientEvent again if delayedClientEvents was cleared
|
|
3121
|
+
assert.notCalled(submitClientEventSpy);
|
|
3122
|
+
});
|
|
3123
|
+
});
|
|
2941
3124
|
});
|
|
2942
3125
|
});
|
|
@@ -59,6 +59,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
59
59
|
webex.internal.newMetrics.callDiagnosticLatencies.saveTimestamp = sinon.stub();
|
|
60
60
|
webex.internal.newMetrics.callDiagnosticLatencies.clearTimestamps = sinon.stub();
|
|
61
61
|
webex.internal.newMetrics.callDiagnosticMetrics.submitClientEvent = sinon.stub();
|
|
62
|
+
webex.internal.newMetrics.callDiagnosticMetrics.submitDelayedClientEvents = sinon.stub();
|
|
62
63
|
webex.internal.newMetrics.callDiagnosticMetrics.submitMQE = sinon.stub();
|
|
63
64
|
webex.internal.newMetrics.callDiagnosticMetrics.clientMetricsAliasUser = sinon.stub();
|
|
64
65
|
webex.internal.newMetrics.callDiagnosticMetrics.buildClientEventFetchRequestOptions =
|
|
@@ -120,6 +121,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
120
121
|
name: 'client.alert.displayed',
|
|
121
122
|
payload: undefined,
|
|
122
123
|
options: {meetingId: '123'},
|
|
124
|
+
delaySubmitEvent: false,
|
|
123
125
|
});
|
|
124
126
|
});
|
|
125
127
|
|
|
@@ -258,5 +260,24 @@ describe('internal-plugin-metrics', () => {
|
|
|
258
260
|
sinon.restore();
|
|
259
261
|
});
|
|
260
262
|
});
|
|
263
|
+
|
|
264
|
+
describe('#setDelaySubmitClientEvents', () => {
|
|
265
|
+
it('sets delaySubmitClientEvents correctly and calls submitDelayedClientEvents when set to false', () => {
|
|
266
|
+
sinon.assert.match(webex.internal.newMetrics.delaySubmitClientEvents, false);
|
|
267
|
+
|
|
268
|
+
webex.internal.newMetrics.setDelaySubmitClientEvents(true);
|
|
269
|
+
|
|
270
|
+
assert.notCalled(webex.internal.newMetrics.callDiagnosticMetrics.submitDelayedClientEvents);
|
|
271
|
+
|
|
272
|
+
sinon.assert.match(webex.internal.newMetrics.delaySubmitClientEvents, true);
|
|
273
|
+
|
|
274
|
+
webex.internal.newMetrics.setDelaySubmitClientEvents(false);
|
|
275
|
+
|
|
276
|
+
assert.calledOnce(webex.internal.newMetrics.callDiagnosticMetrics.submitDelayedClientEvents);
|
|
277
|
+
assert.calledWith(webex.internal.newMetrics.callDiagnosticMetrics.submitDelayedClientEvents);
|
|
278
|
+
|
|
279
|
+
sinon.assert.match(webex.internal.newMetrics.delaySubmitClientEvents, false);
|
|
280
|
+
});
|
|
281
|
+
});
|
|
261
282
|
});
|
|
262
283
|
});
|