@webex/internal-plugin-metrics 3.12.0-next.8 → 3.12.0-task-refactor.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.
Files changed (42) hide show
  1. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +34 -41
  2. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
  3. package/dist/call-diagnostic/call-diagnostic-metrics.js +0 -5
  4. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
  5. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +4 -39
  6. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
  7. package/dist/call-diagnostic/config.js +1 -3
  8. package/dist/call-diagnostic/config.js.map +1 -1
  9. package/dist/generic-metrics.js +6 -8
  10. package/dist/generic-metrics.js.map +1 -1
  11. package/dist/index.js +0 -7
  12. package/dist/index.js.map +1 -1
  13. package/dist/metrics.js +1 -1
  14. package/dist/metrics.types.js.map +1 -1
  15. package/dist/new-metrics.js +20 -56
  16. package/dist/new-metrics.js.map +1 -1
  17. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +0 -8
  18. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +20 -34
  19. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +2 -23
  20. package/dist/types/call-diagnostic/config.d.ts +19 -2
  21. package/dist/types/config.d.ts +15 -15
  22. package/dist/types/index.d.ts +1 -2
  23. package/dist/types/metrics.types.d.ts +2 -2
  24. package/dist/types/new-metrics.d.ts +0 -12
  25. package/package.json +11 -11
  26. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +44 -89
  27. package/src/call-diagnostic/call-diagnostic-metrics.ts +0 -6
  28. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +2 -44
  29. package/src/call-diagnostic/config.ts +0 -2
  30. package/src/generic-metrics.ts +6 -6
  31. package/src/index.ts +0 -2
  32. package/src/metrics.types.ts +2 -2
  33. package/src/new-metrics.ts +0 -42
  34. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +11 -38
  35. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +301 -227
  36. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +0 -44
  37. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +3 -65
  38. package/dist/prelogin-metrics.js +0 -106
  39. package/dist/prelogin-metrics.js.map +0 -1
  40. package/dist/types/prelogin-metrics.d.ts +0 -47
  41. package/src/prelogin-metrics.ts +0 -94
  42. package/test/unit/spec/prelogin-metrics.ts +0 -132
@@ -59,27 +59,6 @@ export declare const isUnauthorizedError: (rawError: any) => boolean;
59
59
  * @returns {boolean}
60
60
  */
61
61
  export declare const isSdpOfferCreationError: (rawError: any) => boolean;
62
- export declare const isWebrtcApiNotAvailableError: (rawError: {
63
- code: number;
64
- message: string;
65
- name: string;
66
- } | unknown) => boolean;
67
- /**
68
- * Checks if the given error is a browser media error by its name.
69
- * Returns true if the error name matches any known browser media error name in the mapping.
70
- *
71
- * @param {Object} rawError - The error object to check.
72
- * @returns {boolean} True if the error is a browser media error, false otherwise.
73
- */
74
- export declare const isBrowserMediaError: (rawError: any) => boolean;
75
- /**
76
- * Returns the client error code mapped to the given browser media error name.
77
- * If the error name is not found in the mapping, returns undefined.
78
- *
79
- * @param {Object} rawError - The error object containing the error name.
80
- * @returns {string|undefined} The mapped client error code, or undefined if not found.
81
- */
82
- export declare const getBrowserMediaErrorCode: (rawError: any) => number;
83
62
  /**
84
63
  * MDN Media Devices getUserMedia() method returns a name if it errs
85
64
  * Documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
@@ -93,7 +72,7 @@ export declare const isBrowserMediaErrorName: (errorName: any) => boolean;
93
72
  * @param webClientDomain
94
73
  * @returns
95
74
  */
96
- export declare const getBuildType: (webex: any, webClientDomain: any, markAsTestEvent?: boolean) => Event['origin']['buildType'];
75
+ export declare const getBuildType: (webex: any, webClientDomain: any, markAsTestEvent?: boolean) => Event["origin"]["buildType"];
97
76
  /**
98
77
  * Prepare metric item for submission.
99
78
  * @param {Object} webex sdk instance
@@ -119,7 +98,7 @@ export declare const extractVersionMetadata: (version: string) => {
119
98
  * that happen when trying to add media in a meeting.
120
99
  */
121
100
  export declare const generateClientErrorCodeForIceFailure: ({ signalingState, iceConnected, turnServerUsed, unreachable, }: {
122
- signalingState: RTCPeerConnection['signalingState'];
101
+ signalingState: RTCPeerConnection["signalingState"];
123
102
  iceConnected: boolean;
124
103
  turnServerUsed: boolean;
125
104
  unreachable: boolean;
@@ -15,8 +15,25 @@ export declare const ICE_AND_REACHABILITY_FAILED_CLIENT_CODE = 2011;
15
15
  export declare const MULTISTREAM_NOT_AVAILABLE_CLIENT_CODE = 2012;
16
16
  export declare const WBX_APP_API_URL = "wbxappapi";
17
17
  export declare const WEBEX_SUB_SERVICE_TYPES: Record<string, ClientSubServiceType>;
18
+ declare const BROWSER_MEDIA_ERROR_NAMES: {
19
+ PERMISSION_DENIED_ERROR: string;
20
+ NOT_ALLOWED_ERROR: string;
21
+ NOT_READABLE_ERROR: string;
22
+ ABORT_ERROR: string;
23
+ NOT_FOUND_ERROR: string;
24
+ OVERCONSTRAINED_ERROR: string;
25
+ SECURITY_ERROR: string;
26
+ TYPE_ERROR: string;
27
+ };
18
28
  export declare const BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP: {
19
- [x: string]: number;
29
+ [BROWSER_MEDIA_ERROR_NAMES.PERMISSION_DENIED_ERROR]: number;
30
+ [BROWSER_MEDIA_ERROR_NAMES.NOT_ALLOWED_ERROR]: number;
31
+ [BROWSER_MEDIA_ERROR_NAMES.NOT_READABLE_ERROR]: number;
32
+ [BROWSER_MEDIA_ERROR_NAMES.ABORT_ERROR]: number;
33
+ [BROWSER_MEDIA_ERROR_NAMES.NOT_FOUND_ERROR]: number;
34
+ [BROWSER_MEDIA_ERROR_NAMES.OVERCONSTRAINED_ERROR]: number;
35
+ [BROWSER_MEDIA_ERROR_NAMES.SECURITY_ERROR]: number;
36
+ [BROWSER_MEDIA_ERROR_NAMES.TYPE_ERROR]: number;
20
37
  };
21
38
  export declare const SDP_OFFER_CREATION_ERROR_MAP: {
22
39
  GENERAL: number;
@@ -99,7 +116,6 @@ export declare const ERROR_DESCRIPTIONS: {
99
116
  MULTISTREAM_NOT_AVAILABLE: string;
100
117
  SDP_OFFER_CREATION_ERROR: string;
101
118
  SDP_OFFER_CREATION_ERROR_MISSING_CODEC: string;
102
- WEBRTC_API_NOT_AVAILABLE: string;
103
119
  WDM_RESTRICTED_REGION: string;
104
120
  USER_NOT_ALLOWED_JOIN_WEBINAR: string;
105
121
  };
@@ -198,3 +214,4 @@ export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
198
214
  export declare const CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD: Record<number, Partial<ClientEventError>>;
199
215
  export declare const CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND = "js_sdk_call_diagnostic_event_failed_to_send";
200
216
  export declare const CALL_FEATURE_EVENT_FAILED_TO_SEND = "js_sdk_call_feature_event_failed_to_send";
217
+ export {};
@@ -2,29 +2,29 @@ export const CLIENT_NAME: "webex-js-sdk";
2
2
  declare namespace _default {
3
3
  export namespace device {
4
4
  namespace preDiscoveryServices {
5
- const metricsServiceUrl: string;
6
- const metrics: string;
5
+ let metricsServiceUrl: string;
6
+ let metrics: string;
7
7
  }
8
8
  }
9
9
  export namespace metrics_1 {
10
- const appType: string;
11
- const batcherWait: number;
12
- const batcherMaxCalls: number;
13
- const batcherMaxWait: number;
14
- const batcherRetryPlateau: number;
15
- const waitForServiceTimeout: number;
10
+ let appType: string;
11
+ let batcherWait: number;
12
+ let batcherMaxCalls: number;
13
+ let batcherMaxWait: number;
14
+ let batcherRetryPlateau: number;
15
+ let waitForServiceTimeout: number;
16
16
  }
17
17
  export { metrics_1 as metrics };
18
18
  }
19
19
  export default _default;
20
20
  export namespace OS_NAME {
21
- const WINDOWS: string;
22
- const MAC: string;
23
- const IOS: string;
24
- const ANDROID: string;
25
- const CHROME: string;
26
- const LINUX: string;
27
- const OTHERS: string;
21
+ let WINDOWS: string;
22
+ let MAC: string;
23
+ let IOS: string;
24
+ let ANDROID: string;
25
+ let CHROME: string;
26
+ let LINUX: string;
27
+ let OTHERS: string;
28
28
  }
29
29
  export const OSMap: {
30
30
  'Chrome OS': string;
@@ -13,7 +13,6 @@ import BehavioralMetrics from './behavioral-metrics';
13
13
  import OperationalMetrics from './operational-metrics';
14
14
  import BusinessMetrics from './business-metrics';
15
15
  import RtcMetrics from './rtcMetrics';
16
- import PreLoginMetrics from './prelogin-metrics';
17
16
  export { default, getOSNameInternal } from './metrics';
18
- export { config, CALL_DIAGNOSTIC_CONFIG, NewMetrics, Utils, CallDiagnosticUtils, CallDiagnosticLatencies, CallDiagnosticMetrics, BehavioralMetrics, OperationalMetrics, BusinessMetrics, RtcMetrics, PreLoginMetrics, };
17
+ export { config, CALL_DIAGNOSTIC_CONFIG, NewMetrics, Utils, CallDiagnosticUtils, CallDiagnosticLatencies, CallDiagnosticMetrics, BehavioralMetrics, OperationalMetrics, BusinessMetrics, RtcMetrics, };
19
18
  export type { ClientEvent, ClientEventLeaveReason, SubmitBehavioralEvent, SubmitClientEvent, SubmitInternalEvent, SubmitMQE, SubmitOperationalEvent, SubmitBusinessEvent, PreComputedLatencies, SubmitFeatureEvent, };
@@ -1,4 +1,4 @@
1
- import type { ClientEvent as RawClientEvent, Event as RawEvent, MediaQualityEvent as RawMediaQualityEvent, FeatureEvent as RawFeatureEvent } from '@webex/event-dictionary-ts';
1
+ import { ClientEvent as RawClientEvent, Event as RawEvent, MediaQualityEvent as RawMediaQualityEvent, FeatureEvent as RawFeatureEvent } from '@webex/event-dictionary-ts';
2
2
  export type Event = Omit<RawEvent, 'event'> & {
3
3
  event: RawClientEvent | RawMediaQualityEvent | RawFeatureEvent;
4
4
  };
@@ -73,7 +73,7 @@ export interface BusinessEventPayload {
73
73
  metricName: string;
74
74
  timestamp: number;
75
75
  context: DeviceContext;
76
- browserDetails: object;
76
+ browserDetails: EventPayload;
77
77
  value: EventPayload;
78
78
  }
79
79
  export interface BusinessEvent {
@@ -3,7 +3,6 @@ import CallDiagnosticMetrics from './call-diagnostic/call-diagnostic-metrics';
3
3
  import BehavioralMetrics from './behavioral-metrics';
4
4
  import OperationalMetrics from './operational-metrics';
5
5
  import BusinessMetrics from './business-metrics';
6
- import PreLoginMetrics from './prelogin-metrics';
7
6
  import { RecursivePartial, MetricEventProduct, MetricEventAgent, MetricEventVerb, ClientEvent, FeatureEvent, EventPayload, MediaQualityEvent, InternalEvent, SubmitClientEventOptions, Table, DelayedClientEvent, DelayedClientFeatureEvent } from './metrics.types';
8
7
  import CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';
9
8
  /**
@@ -18,7 +17,6 @@ declare class Metrics extends WebexPlugin {
18
17
  behavioralMetrics: BehavioralMetrics;
19
18
  operationalMetrics: OperationalMetrics;
20
19
  businessMetrics: BusinessMetrics;
21
- preLoginMetrics: PreLoginMetrics;
22
20
  isReady: boolean;
23
21
  /**
24
22
  * Whether or not to delay the submission of client events.
@@ -107,16 +105,6 @@ declare class Metrics extends WebexPlugin {
107
105
  table?: Table;
108
106
  metadata?: EventPayload;
109
107
  }): Promise<void>;
110
- /**
111
- * Call Analyzer: Pre-Login Event
112
- * @param args
113
- */
114
- submitPreLoginEvent({ name, preLoginId, payload, metadata, }: {
115
- name: string;
116
- preLoginId: string;
117
- payload: EventPayload;
118
- metadata?: EventPayload;
119
- }): Promise<void>;
120
108
  /**
121
109
  * Call Analyzer: Media Quality Event
122
110
  * @param args
package/package.json CHANGED
@@ -24,23 +24,23 @@
24
24
  "@sinonjs/fake-timers": "^6.0.1",
25
25
  "@webex/babel-config-legacy": "0.0.0",
26
26
  "@webex/eslint-config-legacy": "0.0.0",
27
- "@webex/event-dictionary-ts": "^1.0.2138",
28
27
  "@webex/jest-config-legacy": "0.0.0",
29
28
  "@webex/legacy-tools": "0.0.0",
30
- "@webex/test-helper-chai": "3.11.0-next.1",
31
- "@webex/test-helper-mocha": "3.11.0-next.1",
32
- "@webex/test-helper-mock-webex": "3.11.0-next.1",
33
- "@webex/test-helper-test-users": "3.11.0-next.1",
29
+ "@webex/test-helper-chai": "3.12.0-task-refactor.1",
30
+ "@webex/test-helper-mocha": "3.12.0-task-refactor.1",
31
+ "@webex/test-helper-mock-webex": "3.12.0-task-refactor.1",
32
+ "@webex/test-helper-test-users": "3.12.0-task-refactor.1",
34
33
  "eslint": "^8.24.0",
35
34
  "prettier": "^2.7.1",
36
35
  "sinon": "^9.2.4"
37
36
  },
38
37
  "dependencies": {
39
- "@webex/common": "3.11.0-next.1",
40
- "@webex/common-timers": "3.11.0-next.1",
41
- "@webex/test-helper-chai": "3.11.0-next.1",
42
- "@webex/test-helper-mock-webex": "3.11.0-next.1",
43
- "@webex/webex-core": "3.12.0-next.8",
38
+ "@webex/common": "3.12.0-task-refactor.1",
39
+ "@webex/common-timers": "3.12.0-task-refactor.1",
40
+ "@webex/event-dictionary-ts": "^1.0.1930",
41
+ "@webex/test-helper-chai": "3.12.0-task-refactor.1",
42
+ "@webex/test-helper-mock-webex": "3.12.0-task-refactor.1",
43
+ "@webex/webex-core": "3.12.0-task-refactor.1",
44
44
  "ip-anonymize": "^0.1.0",
45
45
  "lodash": "^4.17.21",
46
46
  "uuid": "^3.3.2"
@@ -53,5 +53,5 @@
53
53
  "test:style": "eslint ./src/**/*.*",
54
54
  "test:unit": "webex-legacy-tools test --unit --runner mocha"
55
55
  },
56
- "version": "3.12.0-next.8"
56
+ "version": "3.12.0-task-refactor.1"
57
57
  }
@@ -193,7 +193,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
193
193
  */
194
194
  public getShowInterstitialTime() {
195
195
  return this.getDiffBetweenTimestamps(
196
- 'internal.client.meeting.interstitial-window.showed',
196
+ 'client.interstitial-window.start-launch',
197
197
  'internal.client.interstitial-window.click.joinbutton'
198
198
  );
199
199
  }
@@ -303,31 +303,10 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
303
303
  * @returns - latency
304
304
  */
305
305
  public getStayLobbyTime() {
306
- return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.lobby.exited');
307
- }
308
-
309
- /**
310
- * Stay lobby time capped by a certain timestamp.
311
- * This is to handle the case where the target end timestamp could happen before the lobby is exited,
312
- * for example media-engine.ready or client.ice.end
313
- * @param endTimestampKey name of the target end event
314
- * @returns - latency
315
- */
316
- public getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames) {
317
- const lobbyStartTimestamp = this.latencyTimestamps.get('client.locus.join.response'); // must exist
318
- const lobbyEndTimestamp = this.latencyTimestamps.get('client.lobby.exited'); // might not exist
319
- const maximumEndTimestamp = this.latencyTimestamps.get(endTimestampKey); // must exist
320
-
321
- if (typeof lobbyStartTimestamp !== 'number' || typeof maximumEndTimestamp !== 'number') {
322
- return undefined;
323
- }
324
-
325
- const endTimestamp =
326
- typeof lobbyEndTimestamp === 'number'
327
- ? Math.min(lobbyEndTimestamp, maximumEndTimestamp)
328
- : maximumEndTimestamp;
329
-
330
- return clamp(endTimestamp - lobbyStartTimestamp, 0, this.MAX_INTEGER);
306
+ return this.getDiffBetweenTimestamps(
307
+ 'client.locus.join.response',
308
+ 'internal.host.meeting.participant.admitted'
309
+ );
331
310
  }
332
311
 
333
312
  /**
@@ -414,7 +393,11 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
414
393
  * @returns - latency
415
394
  */
416
395
  public getCallInitMediaEngineReady() {
417
- return this.getInterstitialToMediaOKJMT();
396
+ return this.getDiffBetweenTimestamps(
397
+ 'internal.client.interstitial-window.click.joinbutton',
398
+ 'client.media-engine.ready',
399
+ {maximum: 1200000}
400
+ );
418
401
  }
419
402
 
420
403
  /**
@@ -422,21 +405,20 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
422
405
  * @returns - latency
423
406
  */
424
407
  public getInterstitialToMediaOKJMT() {
425
- const interstitialClickJoinToIceEnd = this.getDiffBetweenTimestamps(
426
- 'internal.client.interstitial-window.click.joinbutton',
427
- 'client.ice.end'
408
+ const interstitialJoinClickTimestamp = this.latencyTimestamps.get(
409
+ 'internal.client.interstitial-window.click.joinbutton'
428
410
  );
429
- const stayLobbyTimeCappedByIceEnd = this.getStayLobbyTimeCappedBy('client.ice.end');
430
411
 
431
- if (
432
- typeof interstitialClickJoinToIceEnd === 'number' &&
433
- typeof stayLobbyTimeCappedByIceEnd === 'number'
434
- ) {
435
- return clamp(
436
- interstitialClickJoinToIceEnd - stayLobbyTimeCappedByIceEnd,
437
- 0,
438
- this.MAX_INTEGER
439
- );
412
+ // get the first timestamp
413
+ const connectedMedia = this.latencyTimestamps.get('client.ice.end');
414
+
415
+ const lobbyTimeLatency = this.getStayLobbyTime();
416
+ const lobbyTime = typeof lobbyTimeLatency === 'number' ? lobbyTimeLatency : 0;
417
+
418
+ if (interstitialJoinClickTimestamp && connectedMedia) {
419
+ const interstitialToMediaOKJmt = connectedMedia - interstitialJoinClickTimestamp - lobbyTime;
420
+
421
+ return clamp(interstitialToMediaOKJmt, 0, this.MAX_INTEGER);
440
422
  }
441
423
 
442
424
  return undefined;
@@ -448,20 +430,10 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
448
430
  */
449
431
  public getTotalJMT() {
450
432
  const clickToInterstitial = this.getClickToInterstitial();
451
- const interstitialClickJoinToJoinLocusResponse = this.getDiffBetweenTimestamps(
452
- 'internal.client.interstitial-window.click.joinbutton',
453
- 'client.locus.join.response'
454
- );
433
+ const interstitialToJoinOk = this.getInterstitialToJoinOK();
455
434
 
456
- if (
457
- typeof clickToInterstitial === 'number' &&
458
- typeof interstitialClickJoinToJoinLocusResponse === 'number'
459
- ) {
460
- return clamp(
461
- clickToInterstitial + interstitialClickJoinToJoinLocusResponse,
462
- 0,
463
- this.MAX_INTEGER
464
- );
435
+ if (typeof clickToInterstitial === 'number' && typeof interstitialToJoinOk === 'number') {
436
+ return clamp(clickToInterstitial + interstitialToJoinOk, 0, this.MAX_INTEGER);
465
437
  }
466
438
 
467
439
  return undefined;
@@ -473,20 +445,13 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
473
445
  */
474
446
  public getTotalJMTWithUserDelay() {
475
447
  const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
476
- const interstitialShowedToJoinLocusResponse = this.getDiffBetweenTimestamps(
477
- 'internal.client.meeting.interstitial-window.showed',
478
- 'client.locus.join.response'
479
- );
448
+ const interstitialToJoinOk = this.getInterstitialToJoinOK();
480
449
 
481
450
  if (
482
451
  typeof clickToInterstitialWithUserDelay === 'number' &&
483
- typeof interstitialShowedToJoinLocusResponse === 'number'
452
+ typeof interstitialToJoinOk === 'number'
484
453
  ) {
485
- return clamp(
486
- clickToInterstitialWithUserDelay + interstitialShowedToJoinLocusResponse,
487
- 0,
488
- this.MAX_INTEGER
489
- );
454
+ return clamp(clickToInterstitialWithUserDelay + interstitialToJoinOk, 0, this.MAX_INTEGER);
490
455
  }
491
456
 
492
457
  return undefined;
@@ -513,26 +478,21 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
513
478
  */
514
479
  public getTotalMediaJMT() {
515
480
  const clickToInterstitial = this.getClickToInterstitial();
516
- const interstitialClickJoinToMediaEngineReady = this.getDiffBetweenTimestamps(
517
- 'internal.client.interstitial-window.click.joinbutton',
518
- 'client.media-engine.ready'
519
- );
520
- const stayLobbyTimeCappedByMediaEngineReady = this.getStayLobbyTimeCappedBy(
521
- 'client.media-engine.ready'
522
- );
481
+ const interstitialToJoinOk = this.getInterstitialToJoinOK();
482
+ const joinConfJMT = this.getJoinConfJMT();
483
+ const lobbyTime = this.getStayLobbyTime();
523
484
 
524
- if (
525
- typeof clickToInterstitial === 'number' &&
526
- typeof interstitialClickJoinToMediaEngineReady === 'number' &&
527
- typeof stayLobbyTimeCappedByMediaEngineReady === 'number'
528
- ) {
529
- return clamp(
530
- clickToInterstitial +
531
- interstitialClickJoinToMediaEngineReady -
532
- stayLobbyTimeCappedByMediaEngineReady,
485
+ if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {
486
+ const totalMediaJMT = clamp(
487
+ clickToInterstitial + interstitialToJoinOk + joinConfJMT,
533
488
  0,
534
- this.MAX_INTEGER
489
+ Infinity
535
490
  );
491
+ if (this.getMeeting()?.allowMediaInLobby) {
492
+ return clamp(totalMediaJMT, 0, this.MAX_INTEGER);
493
+ }
494
+
495
+ return clamp(totalMediaJMT - lobbyTime, 0, this.MAX_INTEGER);
536
496
  }
537
497
 
538
498
  return undefined;
@@ -544,17 +504,12 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
544
504
  */
545
505
  public getTotalMediaJMTWithUserDelay() {
546
506
  const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
547
- const interstitialShowedToMediaEngineReady = this.getDiffBetweenTimestamps(
548
- 'internal.client.meeting.interstitial-window.showed',
549
- 'client.media-engine.ready'
550
- );
507
+ const interstitialToJoinOk = this.getInterstitialToJoinOK();
508
+ const joinConfJMT = this.getJoinConfJMT();
551
509
 
552
- if (
553
- typeof clickToInterstitialWithUserDelay === 'number' &&
554
- typeof interstitialShowedToMediaEngineReady === 'number'
555
- ) {
510
+ if (clickToInterstitialWithUserDelay && interstitialToJoinOk && joinConfJMT) {
556
511
  return clamp(
557
- clickToInterstitialWithUserDelay + interstitialShowedToMediaEngineReady,
512
+ clickToInterstitialWithUserDelay + interstitialToJoinOk + joinConfJMT,
558
513
  0,
559
514
  this.MAX_INTEGER
560
515
  );
@@ -190,11 +190,6 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
190
190
 
191
191
  // if ConvergedArchitecture enable and isConvergedWebinarWebcast -- then webcast
192
192
  if (meetingInfo?.enableConvergedArchitecture && meetingInfo?.enableEvent) {
193
- // if enableConvergedWebinarLargeScale - then large scale webinar
194
- if (meetingInfo?.enableConvergedWebinarLargeScale) {
195
- return WEBEX_SUB_SERVICE_TYPES.LARGE_SCALE_WEBINAR;
196
- }
197
-
198
193
  return meetingInfo?.isConvergedWebinarWebcast
199
194
  ? WEBEX_SUB_SERVICE_TYPES.WEBCAST
200
195
  : WEBEX_SUB_SERVICE_TYPES.WEBINAR;
@@ -371,7 +366,6 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
371
366
  if (meeting?.locusInfo?.fullState) {
372
367
  identifiers.locusUrl = meeting.locusUrl;
373
368
  identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();
374
- identifiers.locusSessionId = meeting.locusInfo.fullState.sessionId;
375
369
  identifiers.locusStartTime =
376
370
  meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;
377
371
  }
@@ -179,43 +179,6 @@ export const isSdpOfferCreationError = (rawError: any) => {
179
179
  return false;
180
180
  };
181
181
 
182
- export const isWebrtcApiNotAvailableError = (
183
- rawError: {code: number; message: string; name: string} | unknown
184
- ) => {
185
- if ((rawError as {name: string}).name === ERROR_DESCRIPTIONS.WEBRTC_API_NOT_AVAILABLE) {
186
- return true;
187
- }
188
-
189
- return false;
190
- };
191
-
192
- /**
193
- * Checks if the given error is a browser media error by its name.
194
- * Returns true if the error name matches any known browser media error name in the mapping.
195
- *
196
- * @param {Object} rawError - The error object to check.
197
- * @returns {boolean} True if the error is a browser media error, false otherwise.
198
- */
199
- export const isBrowserMediaError = (rawError) => {
200
- // eslint-disable-next-line no-use-before-define
201
- if (isBrowserMediaErrorName(rawError.name)) {
202
- return true;
203
- }
204
-
205
- return false;
206
- };
207
-
208
- /**
209
- * Returns the client error code mapped to the given browser media error name.
210
- * If the error name is not found in the mapping, returns undefined.
211
- *
212
- * @param {Object} rawError - The error object containing the error name.
213
- * @returns {string|undefined} The mapped client error code, or undefined if not found.
214
- */
215
- export const getBrowserMediaErrorCode = (rawError) => {
216
- return BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP[rawError.name];
217
- };
218
-
219
182
  /**
220
183
  * MDN Media Devices getUserMedia() method returns a name if it errs
221
184
  * Documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
@@ -284,8 +247,7 @@ export const prepareDiagnosticMetricItem = (webex: any, item: any) => {
284
247
  devicePairingType: webex.devicemanager.getPairedMethod(),
285
248
  deviceURL: pairedDevice.url,
286
249
  isPersonalDevice: pairedDevice.mode === 'personal',
287
- productName:
288
- pairedDevice.devices?.length > 0 ? pairedDevice.devices[0]?.productName : undefined,
250
+ productName: pairedDevice.devices[0]?.productName,
289
251
  };
290
252
  item.eventPayload.event.pairingState = 'paired';
291
253
  item.eventPayload.event.pairedDevice = devicePayload;
@@ -362,6 +324,7 @@ export const prepareDiagnosticMetricItem = (webex: any, item: any) => {
362
324
  joinTimes.totalMediaJMT = cdl.getTotalMediaJMT();
363
325
  joinTimes.interstitialToMediaOKJMT = cdl.getInterstitialToMediaOKJMT();
364
326
  joinTimes.callInitMediaEngineReady = cdl.getCallInitMediaEngineReady();
327
+ joinTimes.stayLobbyTime = cdl.getStayLobbyTime();
365
328
  joinTimes.totalMediaJMTWithUserDelay = cdl.getTotalMediaJMTWithUserDelay();
366
329
  joinTimes.totalJMTWithUserDelay = cdl.getTotalJMTWithUserDelay();
367
330
  break;
@@ -369,11 +332,6 @@ export const prepareDiagnosticMetricItem = (webex: any, item: any) => {
369
332
  case 'client.media.tx.start':
370
333
  audioSetupDelay.joinRespTxStart = cdl.getAudioJoinRespTxStart();
371
334
  videoSetupDelay.joinRespTxStart = cdl.getVideoJoinRespTxStart();
372
- break;
373
-
374
- case 'client.lobby.exited':
375
- joinTimes.stayLobbyTime = cdl.getStayLobbyTime();
376
- break;
377
335
  }
378
336
 
379
337
  if (!isEmpty(joinTimes)) {
@@ -26,7 +26,6 @@ export const WEBEX_SUB_SERVICE_TYPES: Record<string, ClientSubServiceType> = {
26
26
  SCHEDULED_MEETING: 'ScheduledMeeting',
27
27
  WEBINAR: 'Webinar',
28
28
  WEBCAST: 'Webcast',
29
- LARGE_SCALE_WEBINAR: 'LargeScaleWebinar',
30
29
  };
31
30
 
32
31
  // Found in https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
@@ -134,7 +133,6 @@ export const ERROR_DESCRIPTIONS = {
134
133
  MULTISTREAM_NOT_AVAILABLE: 'MultistreamNotAvailable',
135
134
  SDP_OFFER_CREATION_ERROR: 'SdpOfferCreationError',
136
135
  SDP_OFFER_CREATION_ERROR_MISSING_CODEC: 'SdpOfferCreationErrorMissingCodec',
137
- WEBRTC_API_NOT_AVAILABLE: 'WebrtcApiNotAvailableError',
138
136
  WDM_RESTRICTED_REGION: 'WdmRestrictedRegion',
139
137
  USER_NOT_ALLOWED_JOIN_WEBINAR: 'UserNotAllowedJoinWebinar',
140
138
  };
@@ -79,7 +79,7 @@ export default abstract class GenericMetrics extends StatelessWebexPlugin {
79
79
  device: {
80
80
  id: this.getDeviceId(),
81
81
  },
82
- locale: window?.navigator.language,
82
+ locale: window.navigator.language,
83
83
  os: {
84
84
  name: getOSNameInternal(),
85
85
  version: getOSVersion(),
@@ -94,12 +94,12 @@ export default abstract class GenericMetrics extends StatelessWebexPlugin {
94
94
  protected getBrowserDetails(): object {
95
95
  return {
96
96
  browser: getBrowserName(),
97
- browserHeight: window?.innerHeight,
97
+ browserHeight: window.innerHeight,
98
98
  browserVersion: getBrowserVersion(),
99
- browserWidth: window?.innerWidth,
100
- domain: window?.location.hostname,
101
- inIframe: window?.self !== window?.top,
102
- locale: window?.navigator.language,
99
+ browserWidth: window.innerWidth,
100
+ domain: window.location.hostname,
101
+ inIframe: window.self !== window.top,
102
+ locale: window.navigator.language,
103
103
  os: getOSNameInternal(),
104
104
  };
105
105
  }
package/src/index.ts CHANGED
@@ -28,7 +28,6 @@ import BehavioralMetrics from './behavioral-metrics';
28
28
  import OperationalMetrics from './operational-metrics';
29
29
  import BusinessMetrics from './business-metrics';
30
30
  import RtcMetrics from './rtcMetrics';
31
- import PreLoginMetrics from './prelogin-metrics';
32
31
 
33
32
  registerInternalPlugin('metrics', Metrics, {
34
33
  config,
@@ -52,7 +51,6 @@ export {
52
51
  OperationalMetrics,
53
52
  BusinessMetrics,
54
53
  RtcMetrics,
55
- PreLoginMetrics,
56
54
  };
57
55
  export type {
58
56
  ClientEvent,
@@ -1,4 +1,4 @@
1
- import type {
1
+ import {
2
2
  ClientEvent as RawClientEvent,
3
3
  Event as RawEvent,
4
4
  MediaQualityEvent as RawMediaQualityEvent,
@@ -197,7 +197,7 @@ export interface BusinessEventPayload {
197
197
  metricName: string;
198
198
  timestamp: number;
199
199
  context: DeviceContext;
200
- browserDetails: object;
200
+ browserDetails: EventPayload;
201
201
  value: EventPayload;
202
202
  }
203
203