@webex/internal-plugin-metrics 3.12.0-next.9 → 3.12.0-webex-services-ready.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/batcher.js +3 -0
- package/dist/batcher.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +23 -0
- package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +29 -25
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +55 -8
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js +5 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
- package/dist/call-diagnostic/config.js +14 -2
- package/dist/call-diagnostic/config.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/metrics.types.js.map +1 -1
- package/dist/prelogin-metrics-batcher.js +23 -0
- package/dist/prelogin-metrics-batcher.js.map +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +23 -0
- package/dist/types/call-diagnostic/config.d.ts +4 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/metrics.types.d.ts +2 -2
- package/package.json +11 -11
- package/src/batcher.js +4 -0
- package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +26 -0
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +54 -38
- package/src/call-diagnostic/call-diagnostic-metrics.ts +46 -1
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +5 -0
- package/src/call-diagnostic/config.ts +13 -0
- package/src/config.js +1 -0
- package/src/metrics.types.ts +1 -1
- package/src/prelogin-metrics-batcher.ts +26 -0
- package/test/unit/spec/batcher.js +43 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +145 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +105 -95
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +680 -159
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +27 -0
- package/test/unit/spec/prelogin-metrics-batcher.ts +190 -36
|
@@ -412,8 +412,10 @@ describe('internal-plugin-metrics', () => {
|
|
|
412
412
|
});
|
|
413
413
|
|
|
414
414
|
it('calculates getCallInitJoinReq correctly', () => {
|
|
415
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 5});
|
|
415
416
|
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
416
417
|
cdl.saveTimestamp({key: 'client.locus.join.request', value: 20});
|
|
418
|
+
// showedToJoinReq = 20-5 = 15, showInterstitialTime = 10-5 = 5, result = 15-5 = 10
|
|
417
419
|
assert.deepEqual(cdl.getCallInitJoinReq(), 10);
|
|
418
420
|
});
|
|
419
421
|
|
|
@@ -574,76 +576,40 @@ describe('internal-plugin-metrics', () => {
|
|
|
574
576
|
});
|
|
575
577
|
|
|
576
578
|
it('calculates getClickToInterstitial correctly', () => {
|
|
577
|
-
cdl.saveTimestamp({
|
|
578
|
-
key: 'internal.client.meeting.click.joinbutton',
|
|
579
|
-
value: 10,
|
|
580
|
-
});
|
|
581
|
-
cdl.saveTimestamp({
|
|
582
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
583
|
-
value: 20,
|
|
584
|
-
});
|
|
585
|
-
assert.deepEqual(cdl.getClickToInterstitial(), 10);
|
|
586
|
-
});
|
|
587
|
-
|
|
588
|
-
it('calculates getClickToInterstitial without join button timestamp', () => {
|
|
589
579
|
cdl.saveLatency('internal.click.to.interstitial', 5);
|
|
590
|
-
cdl.saveTimestamp({
|
|
591
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
592
|
-
value: 20,
|
|
593
|
-
});
|
|
594
580
|
assert.deepEqual(cdl.getClickToInterstitial(), 5);
|
|
595
581
|
});
|
|
596
582
|
|
|
597
|
-
it('calculates getClickToInterstitial
|
|
583
|
+
it('calculates getClickToInterstitial correctly when it is 0', () => {
|
|
598
584
|
cdl.saveLatency('internal.click.to.interstitial', 0);
|
|
599
|
-
cdl.saveTimestamp({
|
|
600
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
601
|
-
value: 20,
|
|
602
|
-
});
|
|
603
585
|
assert.deepEqual(cdl.getClickToInterstitial(), 0);
|
|
604
586
|
});
|
|
605
587
|
|
|
606
|
-
it('calculates getClickToInterstitial
|
|
588
|
+
it('calculates getClickToInterstitial correctly when it is greater than MAX_INTEGER', () => {
|
|
607
589
|
cdl.saveLatency('internal.click.to.interstitial', 2147483648);
|
|
608
590
|
assert.deepEqual(cdl.getClickToInterstitial(), 2147483647);
|
|
609
591
|
});
|
|
610
592
|
|
|
611
593
|
it('calculates getClickToInterstitialWithUserDelay correctly', () => {
|
|
612
|
-
cdl.saveTimestamp({
|
|
613
|
-
key: 'internal.client.meeting.click.joinbutton',
|
|
614
|
-
value: 10,
|
|
615
|
-
});
|
|
616
|
-
cdl.saveTimestamp({
|
|
617
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
618
|
-
value: 20,
|
|
619
|
-
});
|
|
620
|
-
assert.deepEqual(cdl.getClickToInterstitialWithUserDelay(), 10);
|
|
621
|
-
});
|
|
622
|
-
|
|
623
|
-
it('calculates getClickToInterstitialWithUserDelay without join button timestamp', () => {
|
|
624
594
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 5);
|
|
625
|
-
cdl.saveTimestamp({
|
|
626
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
627
|
-
value: 20,
|
|
628
|
-
});
|
|
629
595
|
assert.deepEqual(cdl.getClickToInterstitialWithUserDelay(), 5);
|
|
630
596
|
});
|
|
631
597
|
|
|
632
|
-
it('calculates getClickToInterstitialWithUserDelay
|
|
598
|
+
it('calculates getClickToInterstitialWithUserDelay correctly when it is 0', () => {
|
|
633
599
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 0);
|
|
634
|
-
cdl.saveTimestamp({
|
|
635
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
636
|
-
value: 20,
|
|
637
|
-
});
|
|
638
600
|
assert.deepEqual(cdl.getClickToInterstitialWithUserDelay(), 0);
|
|
639
601
|
});
|
|
640
602
|
|
|
641
|
-
it('calculates getClickToInterstitialWithUserDelay
|
|
603
|
+
it('calculates getClickToInterstitialWithUserDelay correctly when it is greater than MAX_INTEGER', () => {
|
|
642
604
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 2147483648);
|
|
643
605
|
assert.deepEqual(cdl.getClickToInterstitialWithUserDelay(), 2147483647);
|
|
644
606
|
});
|
|
645
607
|
|
|
646
608
|
it('calculates getInterstitialToJoinOK correctly', () => {
|
|
609
|
+
cdl.saveTimestamp({
|
|
610
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
611
|
+
value: 5,
|
|
612
|
+
});
|
|
647
613
|
cdl.saveTimestamp({
|
|
648
614
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
649
615
|
value: 10,
|
|
@@ -652,12 +618,13 @@ describe('internal-plugin-metrics', () => {
|
|
|
652
618
|
key: 'client.locus.join.response',
|
|
653
619
|
value: 20,
|
|
654
620
|
});
|
|
621
|
+
// showedToJoinResp = 20-5 = 15, showInterstitialTime = 10-5 = 5, result = 15-5 = 10
|
|
655
622
|
assert.deepEqual(cdl.getInterstitialToJoinOK(), 10);
|
|
656
623
|
});
|
|
657
624
|
|
|
658
625
|
it('calculates getInterstitialToJoinOK correctly when one value is not a number', () => {
|
|
659
626
|
cdl.saveTimestamp({
|
|
660
|
-
key: 'internal.client.interstitial-window.
|
|
627
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
661
628
|
value: 'ten' as unknown as number,
|
|
662
629
|
});
|
|
663
630
|
cdl.saveTimestamp({
|
|
@@ -673,10 +640,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
673
640
|
});
|
|
674
641
|
|
|
675
642
|
it('calculates getTotalJMT correctly', () => {
|
|
676
|
-
cdl.
|
|
677
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
678
|
-
value: 5,
|
|
679
|
-
});
|
|
643
|
+
cdl.saveLatency('internal.click.to.interstitial', 10);
|
|
680
644
|
cdl.saveTimestamp({
|
|
681
645
|
key: 'internal.client.meeting.click.joinbutton',
|
|
682
646
|
value: 10,
|
|
@@ -685,29 +649,39 @@ describe('internal-plugin-metrics', () => {
|
|
|
685
649
|
key: 'internal.client.meeting.interstitial-window.showed',
|
|
686
650
|
value: 20,
|
|
687
651
|
});
|
|
652
|
+
cdl.saveTimestamp({
|
|
653
|
+
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
654
|
+
value: 25,
|
|
655
|
+
});
|
|
688
656
|
cdl.saveTimestamp({
|
|
689
657
|
key: 'client.locus.join.response',
|
|
690
658
|
value: 40,
|
|
691
659
|
});
|
|
692
|
-
|
|
660
|
+
// clickToInterstitial = 20-10 = 10
|
|
661
|
+
// showedToJoinLocusResponse = 40-20 = 20
|
|
662
|
+
// showInterstitialTime = 25-20 = 5
|
|
663
|
+
// total = 10 + 20 - 5 = 25
|
|
664
|
+
assert.deepEqual(cdl.getTotalJMT(), 25);
|
|
693
665
|
});
|
|
694
666
|
|
|
695
667
|
it('calculates getTotalJMT correctly when clickToInterstitial is 0', () => {
|
|
696
668
|
cdl.saveLatency('internal.click.to.interstitial', 0);
|
|
697
669
|
cdl.saveTimestamp({
|
|
698
|
-
key: 'internal.client.interstitial-window.
|
|
670
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
699
671
|
value: 20,
|
|
700
672
|
});
|
|
701
673
|
cdl.saveTimestamp({
|
|
702
674
|
key: 'client.locus.join.response',
|
|
703
675
|
value: 40,
|
|
704
676
|
});
|
|
677
|
+
// showedToJoinLocusResponse = 40-20 = 20, showInterstitialTime = 0
|
|
678
|
+
// total = 0 + 20 - 0 = 20
|
|
705
679
|
assert.deepEqual(cdl.getTotalJMT(), 20);
|
|
706
680
|
});
|
|
707
681
|
|
|
708
682
|
it('calculates getTotalJMT correctly when interstitialClickJoinToJoinLocusResponse is 0', () => {
|
|
709
683
|
cdl.saveTimestamp({
|
|
710
|
-
key: 'internal.client.interstitial-window.
|
|
684
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
711
685
|
value: 40,
|
|
712
686
|
});
|
|
713
687
|
cdl.saveLatency('internal.click.to.interstitial', 12);
|
|
@@ -715,12 +689,14 @@ describe('internal-plugin-metrics', () => {
|
|
|
715
689
|
key: 'client.locus.join.response',
|
|
716
690
|
value: 40,
|
|
717
691
|
});
|
|
692
|
+
// showedToJoinLocusResponse = 0, showInterstitialTime = 0
|
|
693
|
+
// total = 12 + 0 - 0 = 12
|
|
718
694
|
assert.deepEqual(cdl.getTotalJMT(), 12);
|
|
719
695
|
});
|
|
720
696
|
|
|
721
697
|
it('calculates getTotalJMT correctly when both clickToInterstitial and interstitialClickJoinToJoinLocusResponse are 0', () => {
|
|
722
698
|
cdl.saveTimestamp({
|
|
723
|
-
key: 'internal.client.interstitial-window.
|
|
699
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
724
700
|
value: 40,
|
|
725
701
|
});
|
|
726
702
|
cdl.saveLatency('internal.click.to.interstitial', 0);
|
|
@@ -733,7 +709,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
733
709
|
|
|
734
710
|
it('calculates getTotalJMT correctly when both clickToInterstitial is not a number', () => {
|
|
735
711
|
cdl.saveTimestamp({
|
|
736
|
-
key: 'internal.client.interstitial-window.
|
|
712
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
737
713
|
value: 40,
|
|
738
714
|
});
|
|
739
715
|
cdl.saveLatency('internal.click.to.interstitial', 'eleven' as unknown as number);
|
|
@@ -746,7 +722,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
746
722
|
|
|
747
723
|
it('calculates getTotalJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
748
724
|
cdl.saveTimestamp({
|
|
749
|
-
key: 'internal.client.interstitial-window.
|
|
725
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
750
726
|
value: 5,
|
|
751
727
|
});
|
|
752
728
|
cdl.saveTimestamp({
|
|
@@ -758,14 +734,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
758
734
|
});
|
|
759
735
|
|
|
760
736
|
it('calculates getTotalJMTWithUserDelay correctly', () => {
|
|
761
|
-
cdl.
|
|
762
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
763
|
-
value: 5,
|
|
764
|
-
});
|
|
765
|
-
cdl.saveTimestamp({
|
|
766
|
-
key: 'internal.client.meeting.click.joinbutton',
|
|
767
|
-
value: 10,
|
|
768
|
-
});
|
|
737
|
+
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 10);
|
|
769
738
|
cdl.saveTimestamp({
|
|
770
739
|
key: 'internal.client.meeting.interstitial-window.showed',
|
|
771
740
|
value: 20,
|
|
@@ -846,48 +815,51 @@ describe('internal-plugin-metrics', () => {
|
|
|
846
815
|
});
|
|
847
816
|
|
|
848
817
|
it('calculates getTotalMediaJMT correctly with lobby exiting before media-engine.ready', () => {
|
|
849
|
-
cdl.
|
|
818
|
+
cdl.saveLatency('internal.click.to.interstitial', 3);
|
|
819
|
+
// clickToInterstitial = 3
|
|
850
820
|
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
851
|
-
// clickToInterstitial = 8 - 5 = 3
|
|
852
821
|
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
853
822
|
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
854
|
-
//
|
|
823
|
+
// interstitialShowedToMediaEngineReady = 50 - 8 = 42
|
|
824
|
+
// showInterstitialTime = 10 - 8 = 2
|
|
855
825
|
cdl.saveTimestamp({key: 'client.lobby.entered', value: 20});
|
|
856
826
|
cdl.saveTimestamp({key: 'client.lobby.exited', value: 30});
|
|
857
827
|
// stayLobbyTimeCappedByMediaEngineReady = min(30, 50) - 20 = 10
|
|
858
|
-
// total = 3 +
|
|
828
|
+
// total = 3 + 42 - 2 - 10 = 33
|
|
859
829
|
assert.deepEqual(cdl.getTotalMediaJMT(), 33);
|
|
860
830
|
});
|
|
861
831
|
|
|
862
832
|
it('calculates getTotalMediaJMT correctly without lobby', () => {
|
|
863
|
-
cdl.
|
|
864
|
-
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
833
|
+
cdl.saveLatency('internal.click.to.interstitial', 3);
|
|
865
834
|
// clickToInterstitial = 3
|
|
835
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
866
836
|
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
867
837
|
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
868
|
-
//
|
|
838
|
+
// interstitialShowedToMediaEngineReady = 50 - 8 = 42
|
|
839
|
+
// showInterstitialTime = 10 - 8 = 2
|
|
869
840
|
// no client.lobby.entered → stayLobbyTimeCappedByMediaEngineReady = 0
|
|
870
|
-
// total = 3 +
|
|
841
|
+
// total = 3 + 42 - 2 - 0 = 43
|
|
871
842
|
assert.deepEqual(cdl.getTotalMediaJMT(), 43);
|
|
872
843
|
});
|
|
873
844
|
|
|
874
845
|
it('calculates getTotalMediaJMT correctly with lobby exiting after media-engine.ready', () => {
|
|
875
|
-
cdl.
|
|
876
|
-
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
846
|
+
cdl.saveLatency('internal.click.to.interstitial', 3);
|
|
877
847
|
// clickToInterstitial = 3
|
|
848
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
878
849
|
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
879
850
|
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
880
|
-
//
|
|
851
|
+
// interstitialShowedToMediaEngineReady = 50 - 8 = 42
|
|
852
|
+
// showInterstitialTime = 10 - 8 = 2
|
|
881
853
|
cdl.saveTimestamp({key: 'client.lobby.entered', value: 20});
|
|
882
854
|
cdl.saveTimestamp({key: 'client.lobby.exited', value: 60});
|
|
883
855
|
// stayLobbyTimeCappedByMediaEngineReady = min(60, 50) - 20 = 30
|
|
884
|
-
// total = 3 +
|
|
856
|
+
// total = 3 + 42 - 2 - 30 = 13
|
|
885
857
|
assert.deepEqual(cdl.getTotalMediaJMT(), 13);
|
|
886
858
|
});
|
|
887
859
|
|
|
888
860
|
it('calculates getTotalMediaJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
889
|
-
cdl.
|
|
890
|
-
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value:
|
|
861
|
+
cdl.saveLatency('internal.click.to.interstitial', 5);
|
|
862
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 10});
|
|
891
863
|
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
892
864
|
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 4294967400});
|
|
893
865
|
cdl.saveTimestamp({key: 'client.lobby.entered', value: 28});
|
|
@@ -896,7 +868,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
896
868
|
});
|
|
897
869
|
|
|
898
870
|
it('returns undefined for getTotalMediaJMT when media-engine.ready is missing', () => {
|
|
899
|
-
cdl.
|
|
871
|
+
cdl.saveLatency('internal.click.to.interstitial', 3);
|
|
900
872
|
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
901
873
|
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
902
874
|
cdl.saveTimestamp({key: 'client.locus.join.response', value: 20});
|
|
@@ -904,14 +876,15 @@ describe('internal-plugin-metrics', () => {
|
|
|
904
876
|
});
|
|
905
877
|
|
|
906
878
|
it('calculates getTotalMediaJMT correctly when there is no lobby and stayLobbyTime defaults to 0', () => {
|
|
907
|
-
cdl.
|
|
879
|
+
cdl.saveLatency('internal.click.to.interstitial', 3);
|
|
880
|
+
// clickToInterstitial = 3
|
|
908
881
|
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
909
|
-
// clickToInterstitial = 8 - 5 = 3
|
|
910
882
|
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
911
883
|
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
912
|
-
//
|
|
884
|
+
// interstitialShowedToMediaEngineReady = 50 - 8 = 42
|
|
885
|
+
// showInterstitialTime = 10 - 8 = 2
|
|
913
886
|
// no client.lobby.entered → stayLobbyTimeCappedByMediaEngineReady = 0
|
|
914
|
-
// total = 3 +
|
|
887
|
+
// total = 3 + 42 - 2 - 0 = 43
|
|
915
888
|
assert.deepEqual(cdl.getTotalMediaJMT(), 43);
|
|
916
889
|
});
|
|
917
890
|
|
|
@@ -926,9 +899,9 @@ describe('internal-plugin-metrics', () => {
|
|
|
926
899
|
});
|
|
927
900
|
|
|
928
901
|
it('calculates getTotalMediaJMTWithUserDelay correctly for guest join', () => {
|
|
929
|
-
cdl.
|
|
902
|
+
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 3);
|
|
903
|
+
// clickToInterstitialWithUserDelay = 3
|
|
930
904
|
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
931
|
-
// clickToInterstitialWithUserDelay = 8 - 5 = 3
|
|
932
905
|
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
933
906
|
// interstitialShowedToMediaEngineReady = 50 - 8 = 42
|
|
934
907
|
// total = 3 + 42 = 45
|
|
@@ -991,6 +964,11 @@ describe('internal-plugin-metrics', () => {
|
|
|
991
964
|
});
|
|
992
965
|
|
|
993
966
|
it('calculates getClientJMT correctly', () => {
|
|
967
|
+
cdl.saveLatency('internal.click.to.interstitial.for.client.jmt', 5);
|
|
968
|
+
cdl.saveTimestamp({
|
|
969
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
970
|
+
value: 1,
|
|
971
|
+
});
|
|
994
972
|
cdl.saveTimestamp({
|
|
995
973
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
996
974
|
value: 2,
|
|
@@ -999,19 +977,30 @@ describe('internal-plugin-metrics', () => {
|
|
|
999
977
|
key: 'client.locus.join.request',
|
|
1000
978
|
value: 6,
|
|
1001
979
|
});
|
|
980
|
+
// showedToLocusJoinRequest = 6-1 = 5, showInterstitialTime = 2-1 = 1
|
|
981
|
+
// clickToInterstitialForClientJmt (5) + 5 - 1 = 9
|
|
982
|
+
assert.deepEqual(cdl.getClientJMT(), 9);
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
it('returns undefined for getClientJMT when clickToInterstitialForClientJmt is missing', () => {
|
|
1002
986
|
cdl.saveTimestamp({
|
|
1003
|
-
key: 'client.
|
|
1004
|
-
value:
|
|
987
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
988
|
+
value: 1,
|
|
1005
989
|
});
|
|
1006
990
|
cdl.saveTimestamp({
|
|
1007
|
-
key: 'client.
|
|
1008
|
-
value:
|
|
991
|
+
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
992
|
+
value: 2,
|
|
1009
993
|
});
|
|
1010
994
|
cdl.saveTimestamp({
|
|
1011
|
-
key: 'client.
|
|
1012
|
-
value:
|
|
995
|
+
key: 'client.locus.join.request',
|
|
996
|
+
value: 6,
|
|
1013
997
|
});
|
|
1014
|
-
assert.deepEqual(cdl.getClientJMT(),
|
|
998
|
+
assert.deepEqual(cdl.getClientJMT(), undefined);
|
|
999
|
+
});
|
|
1000
|
+
|
|
1001
|
+
it('returns undefined for getClientJMT when interstitialJoinToLocusJoinRequest is missing', () => {
|
|
1002
|
+
cdl.saveLatency('internal.click.to.interstitial.for.client.jmt', 5);
|
|
1003
|
+
assert.deepEqual(cdl.getClientJMT(), undefined);
|
|
1015
1004
|
});
|
|
1016
1005
|
|
|
1017
1006
|
it('calculates getAudioJoinRespRxStart correctly', () => {
|
|
@@ -1063,6 +1052,10 @@ describe('internal-plugin-metrics', () => {
|
|
|
1063
1052
|
});
|
|
1064
1053
|
|
|
1065
1054
|
it('calculates getInterstitialToMediaOKJMT correctly', () => {
|
|
1055
|
+
cdl.saveTimestamp({
|
|
1056
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
1057
|
+
value: 2,
|
|
1058
|
+
});
|
|
1066
1059
|
cdl.saveTimestamp({
|
|
1067
1060
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
1068
1061
|
value: 4,
|
|
@@ -1079,10 +1072,17 @@ describe('internal-plugin-metrics', () => {
|
|
|
1079
1072
|
key: 'client.ice.end',
|
|
1080
1073
|
value: 14,
|
|
1081
1074
|
});
|
|
1075
|
+
// showedToIceEnd = 14-2 = 12, showInterstitialTime = 4-2 = 2
|
|
1076
|
+
// stayLobbyTimeCappedByIceEnd = min(12,14)-10 = 2
|
|
1077
|
+
// result = 12 - 2 - 2 = 8
|
|
1082
1078
|
assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 8);
|
|
1083
1079
|
});
|
|
1084
1080
|
|
|
1085
1081
|
it('calculates getInterstitialToMediaOKJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
1082
|
+
cdl.saveTimestamp({
|
|
1083
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
1084
|
+
value: 4,
|
|
1085
|
+
});
|
|
1086
1086
|
cdl.saveTimestamp({
|
|
1087
1087
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
1088
1088
|
value: 4,
|
|
@@ -1103,6 +1103,10 @@ describe('internal-plugin-metrics', () => {
|
|
|
1103
1103
|
});
|
|
1104
1104
|
|
|
1105
1105
|
it('calculates getInterstitialToMediaOKJMT correctly without lobby', () => {
|
|
1106
|
+
cdl.saveTimestamp({
|
|
1107
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
1108
|
+
value: 2,
|
|
1109
|
+
});
|
|
1106
1110
|
cdl.saveTimestamp({
|
|
1107
1111
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
1108
1112
|
value: 4,
|
|
@@ -1111,12 +1115,17 @@ describe('internal-plugin-metrics', () => {
|
|
|
1111
1115
|
key: 'client.ice.end',
|
|
1112
1116
|
value: 14,
|
|
1113
1117
|
});
|
|
1114
|
-
//
|
|
1115
|
-
//
|
|
1118
|
+
// showedToIceEnd = 14-2 = 12, showInterstitialTime = 4-2 = 2
|
|
1119
|
+
// stayLobbyTimeCappedByIceEnd = 0 (no lobby)
|
|
1120
|
+
// result = 12 - 2 - 0 = 10
|
|
1116
1121
|
assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 10);
|
|
1117
1122
|
});
|
|
1118
1123
|
|
|
1119
1124
|
it('calculates getInterstitialToMediaOKJMT correctly when there is no lobby and stayLobbyTime defaults to 0', () => {
|
|
1125
|
+
cdl.saveTimestamp({
|
|
1126
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
1127
|
+
value: 2,
|
|
1128
|
+
});
|
|
1120
1129
|
cdl.saveTimestamp({
|
|
1121
1130
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
1122
1131
|
value: 4,
|
|
@@ -1125,8 +1134,9 @@ describe('internal-plugin-metrics', () => {
|
|
|
1125
1134
|
key: 'client.ice.end',
|
|
1126
1135
|
value: 14,
|
|
1127
1136
|
});
|
|
1128
|
-
//
|
|
1129
|
-
//
|
|
1137
|
+
// showedToIceEnd = 14-2 = 12, showInterstitialTime = 4-2 = 2
|
|
1138
|
+
// stayLobbyTimeCappedByIceEnd = 0 (no lobby)
|
|
1139
|
+
// result = 12 - 2 - 0 = 10
|
|
1130
1140
|
assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 10);
|
|
1131
1141
|
});
|
|
1132
1142
|
|