@webex/internal-plugin-metrics 3.12.0-next.9 → 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.
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +34 -48
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +0 -5
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js +4 -39
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
- package/dist/call-diagnostic/config.js +1 -3
- package/dist/call-diagnostic/config.js.map +1 -1
- package/dist/generic-metrics.js +6 -8
- package/dist/generic-metrics.js.map +1 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/metrics.types.js.map +1 -1
- package/dist/new-metrics.js +20 -56
- package/dist/new-metrics.js.map +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +0 -9
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +20 -34
- package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +2 -23
- package/dist/types/call-diagnostic/config.d.ts +19 -2
- package/dist/types/config.d.ts +15 -15
- package/dist/types/index.d.ts +1 -2
- package/dist/types/metrics.types.d.ts +2 -2
- package/dist/types/new-metrics.d.ts +0 -12
- package/package.json +11 -11
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +44 -97
- package/src/call-diagnostic/call-diagnostic-metrics.ts +0 -6
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +2 -44
- package/src/call-diagnostic/config.ts +0 -2
- package/src/generic-metrics.ts +6 -6
- package/src/index.ts +0 -2
- package/src/metrics.types.ts +2 -2
- package/src/new-metrics.ts +0 -42
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +11 -38
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +303 -251
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +0 -44
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +3 -65
- package/dist/prelogin-metrics.js +0 -106
- package/dist/prelogin-metrics.js.map +0 -1
- package/dist/types/prelogin-metrics.d.ts +0 -47
- package/src/prelogin-metrics.ts +0 -94
- 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[
|
|
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[
|
|
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
|
-
[
|
|
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 {};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
5
|
+
let metricsServiceUrl: string;
|
|
6
|
+
let metrics: string;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
export namespace metrics_1 {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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,
|
|
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
|
|
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:
|
|
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.
|
|
31
|
-
"@webex/test-helper-mocha": "3.
|
|
32
|
-
"@webex/test-helper-mock-webex": "3.
|
|
33
|
-
"@webex/test-helper-test-users": "3.
|
|
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.
|
|
40
|
-
"@webex/common-timers": "3.
|
|
41
|
-
"@webex/
|
|
42
|
-
"@webex/test-helper-
|
|
43
|
-
"@webex/webex
|
|
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-
|
|
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
|
-
'
|
|
196
|
+
'client.interstitial-window.start-launch',
|
|
197
197
|
'internal.client.interstitial-window.click.joinbutton'
|
|
198
198
|
);
|
|
199
199
|
}
|
|
@@ -303,39 +303,10 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
303
303
|
* @returns - latency
|
|
304
304
|
*/
|
|
305
305
|
public getStayLobbyTime() {
|
|
306
|
-
return this.getDiffBetweenTimestamps(
|
|
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
|
-
* This is supposed to be called AFTER the end timestamp happens
|
|
314
|
-
* @param endTimestampKey name of the target end event
|
|
315
|
-
* @returns - latency
|
|
316
|
-
*/
|
|
317
|
-
public getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames) {
|
|
318
|
-
const lobbyStartTimestamp = this.latencyTimestamps.get('client.lobby.entered'); // might not exist (some meetings don't have lobby)
|
|
319
|
-
|
|
320
|
-
if (typeof lobbyStartTimestamp !== 'number') {
|
|
321
|
-
// no lobby in the meeting, stayLobbyTime is 0
|
|
322
|
-
return 0;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
const lobbyEndTimestamp = this.latencyTimestamps.get('client.lobby.exited'); // might not exist (if user still in lobby at the time of measurement)
|
|
326
|
-
const maximumEndTimestamp = this.latencyTimestamps.get(endTimestampKey); // must exist
|
|
327
|
-
|
|
328
|
-
if (typeof maximumEndTimestamp !== 'number') {
|
|
329
|
-
// the provided timestamp to be used as a cap should exist, return undefined if it doesn't
|
|
330
|
-
return undefined;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
const endTimestamp =
|
|
334
|
-
typeof lobbyEndTimestamp === 'number'
|
|
335
|
-
? Math.min(lobbyEndTimestamp, maximumEndTimestamp)
|
|
336
|
-
: maximumEndTimestamp;
|
|
337
|
-
|
|
338
|
-
return clamp(endTimestamp - lobbyStartTimestamp, 0, this.MAX_INTEGER);
|
|
306
|
+
return this.getDiffBetweenTimestamps(
|
|
307
|
+
'client.locus.join.response',
|
|
308
|
+
'internal.host.meeting.participant.admitted'
|
|
309
|
+
);
|
|
339
310
|
}
|
|
340
311
|
|
|
341
312
|
/**
|
|
@@ -422,7 +393,11 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
422
393
|
* @returns - latency
|
|
423
394
|
*/
|
|
424
395
|
public getCallInitMediaEngineReady() {
|
|
425
|
-
return this.
|
|
396
|
+
return this.getDiffBetweenTimestamps(
|
|
397
|
+
'internal.client.interstitial-window.click.joinbutton',
|
|
398
|
+
'client.media-engine.ready',
|
|
399
|
+
{maximum: 1200000}
|
|
400
|
+
);
|
|
426
401
|
}
|
|
427
402
|
|
|
428
403
|
/**
|
|
@@ -430,21 +405,20 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
430
405
|
* @returns - latency
|
|
431
406
|
*/
|
|
432
407
|
public getInterstitialToMediaOKJMT() {
|
|
433
|
-
const
|
|
434
|
-
'internal.client.interstitial-window.click.joinbutton'
|
|
435
|
-
'client.ice.end'
|
|
408
|
+
const interstitialJoinClickTimestamp = this.latencyTimestamps.get(
|
|
409
|
+
'internal.client.interstitial-window.click.joinbutton'
|
|
436
410
|
);
|
|
437
|
-
const stayLobbyTimeCappedByIceEnd = this.getStayLobbyTimeCappedBy('client.ice.end');
|
|
438
411
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
)
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
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);
|
|
448
422
|
}
|
|
449
423
|
|
|
450
424
|
return undefined;
|
|
@@ -456,20 +430,10 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
456
430
|
*/
|
|
457
431
|
public getTotalJMT() {
|
|
458
432
|
const clickToInterstitial = this.getClickToInterstitial();
|
|
459
|
-
const
|
|
460
|
-
'internal.client.interstitial-window.click.joinbutton',
|
|
461
|
-
'client.locus.join.response'
|
|
462
|
-
);
|
|
433
|
+
const interstitialToJoinOk = this.getInterstitialToJoinOK();
|
|
463
434
|
|
|
464
|
-
if (
|
|
465
|
-
|
|
466
|
-
typeof interstitialClickJoinToJoinLocusResponse === 'number'
|
|
467
|
-
) {
|
|
468
|
-
return clamp(
|
|
469
|
-
clickToInterstitial + interstitialClickJoinToJoinLocusResponse,
|
|
470
|
-
0,
|
|
471
|
-
this.MAX_INTEGER
|
|
472
|
-
);
|
|
435
|
+
if (typeof clickToInterstitial === 'number' && typeof interstitialToJoinOk === 'number') {
|
|
436
|
+
return clamp(clickToInterstitial + interstitialToJoinOk, 0, this.MAX_INTEGER);
|
|
473
437
|
}
|
|
474
438
|
|
|
475
439
|
return undefined;
|
|
@@ -481,20 +445,13 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
481
445
|
*/
|
|
482
446
|
public getTotalJMTWithUserDelay() {
|
|
483
447
|
const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
|
|
484
|
-
const
|
|
485
|
-
'internal.client.meeting.interstitial-window.showed',
|
|
486
|
-
'client.locus.join.response'
|
|
487
|
-
);
|
|
448
|
+
const interstitialToJoinOk = this.getInterstitialToJoinOK();
|
|
488
449
|
|
|
489
450
|
if (
|
|
490
451
|
typeof clickToInterstitialWithUserDelay === 'number' &&
|
|
491
|
-
typeof
|
|
452
|
+
typeof interstitialToJoinOk === 'number'
|
|
492
453
|
) {
|
|
493
|
-
return clamp(
|
|
494
|
-
clickToInterstitialWithUserDelay + interstitialShowedToJoinLocusResponse,
|
|
495
|
-
0,
|
|
496
|
-
this.MAX_INTEGER
|
|
497
|
-
);
|
|
454
|
+
return clamp(clickToInterstitialWithUserDelay + interstitialToJoinOk, 0, this.MAX_INTEGER);
|
|
498
455
|
}
|
|
499
456
|
|
|
500
457
|
return undefined;
|
|
@@ -521,26 +478,21 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
521
478
|
*/
|
|
522
479
|
public getTotalMediaJMT() {
|
|
523
480
|
const clickToInterstitial = this.getClickToInterstitial();
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
);
|
|
528
|
-
const stayLobbyTimeCappedByMediaEngineReady = this.getStayLobbyTimeCappedBy(
|
|
529
|
-
'client.media-engine.ready'
|
|
530
|
-
);
|
|
481
|
+
const interstitialToJoinOk = this.getInterstitialToJoinOK();
|
|
482
|
+
const joinConfJMT = this.getJoinConfJMT();
|
|
483
|
+
const lobbyTime = this.getStayLobbyTime();
|
|
531
484
|
|
|
532
|
-
if (
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
typeof stayLobbyTimeCappedByMediaEngineReady === 'number'
|
|
536
|
-
) {
|
|
537
|
-
return clamp(
|
|
538
|
-
clickToInterstitial +
|
|
539
|
-
interstitialClickJoinToMediaEngineReady -
|
|
540
|
-
stayLobbyTimeCappedByMediaEngineReady,
|
|
485
|
+
if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {
|
|
486
|
+
const totalMediaJMT = clamp(
|
|
487
|
+
clickToInterstitial + interstitialToJoinOk + joinConfJMT,
|
|
541
488
|
0,
|
|
542
|
-
|
|
489
|
+
Infinity
|
|
543
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);
|
|
544
496
|
}
|
|
545
497
|
|
|
546
498
|
return undefined;
|
|
@@ -552,17 +504,12 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
552
504
|
*/
|
|
553
505
|
public getTotalMediaJMTWithUserDelay() {
|
|
554
506
|
const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
'client.media-engine.ready'
|
|
558
|
-
);
|
|
507
|
+
const interstitialToJoinOk = this.getInterstitialToJoinOK();
|
|
508
|
+
const joinConfJMT = this.getJoinConfJMT();
|
|
559
509
|
|
|
560
|
-
if (
|
|
561
|
-
typeof clickToInterstitialWithUserDelay === 'number' &&
|
|
562
|
-
typeof interstitialShowedToMediaEngineReady === 'number'
|
|
563
|
-
) {
|
|
510
|
+
if (clickToInterstitialWithUserDelay && interstitialToJoinOk && joinConfJMT) {
|
|
564
511
|
return clamp(
|
|
565
|
-
clickToInterstitialWithUserDelay +
|
|
512
|
+
clickToInterstitialWithUserDelay + interstitialToJoinOk + joinConfJMT,
|
|
566
513
|
0,
|
|
567
514
|
this.MAX_INTEGER
|
|
568
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
|
};
|
package/src/generic-metrics.ts
CHANGED
|
@@ -79,7 +79,7 @@ export default abstract class GenericMetrics extends StatelessWebexPlugin {
|
|
|
79
79
|
device: {
|
|
80
80
|
id: this.getDeviceId(),
|
|
81
81
|
},
|
|
82
|
-
locale: window
|
|
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
|
|
97
|
+
browserHeight: window.innerHeight,
|
|
98
98
|
browserVersion: getBrowserVersion(),
|
|
99
|
-
browserWidth: window
|
|
100
|
-
domain: window
|
|
101
|
-
inIframe: window
|
|
102
|
-
locale: window
|
|
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,
|
package/src/metrics.types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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:
|
|
200
|
+
browserDetails: EventPayload;
|
|
201
201
|
value: EventPayload;
|
|
202
202
|
}
|
|
203
203
|
|