@webex/internal-plugin-metrics 3.0.0-beta.222 → 3.0.0-beta.223
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-batcher.js +11 -3
- package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +43 -5
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/config.js +3 -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 +65 -0
- package/dist/new-metrics.js.map +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +32 -9
- package/dist/types/call-diagnostic/config.d.ts +1 -0
- package/dist/types/metrics.types.d.ts +2 -3
- package/dist/types/new-metrics.d.ts +14 -0
- package/package.json +9 -8
- package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +36 -8
- package/src/call-diagnostic/call-diagnostic-metrics.ts +79 -2
- package/src/call-diagnostic/config.ts +2 -0
- package/src/metrics.types.ts +6 -3
- package/src/new-metrics.ts +68 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +96 -19
- package/test/unit/spec/new-metrics.ts +30 -0
- package/dist/call-diagnostic/generated-types-temp/ClientEvent.js +0 -7
- package/dist/call-diagnostic/generated-types-temp/ClientEvent.js.map +0 -1
- package/dist/call-diagnostic/generated-types-temp/Event.js +0 -7
- package/dist/call-diagnostic/generated-types-temp/Event.js.map +0 -1
- package/dist/call-diagnostic/generated-types-temp/MediaQualityEvent.js +0 -7
- package/dist/call-diagnostic/generated-types-temp/MediaQualityEvent.js.map +0 -1
- package/dist/types/call-diagnostic/generated-types-temp/ClientEvent.d.ts +0 -1112
- package/dist/types/call-diagnostic/generated-types-temp/Event.d.ts +0 -4851
- package/dist/types/call-diagnostic/generated-types-temp/MediaQualityEvent.d.ts +0 -2121
- package/src/call-diagnostic/generated-types-temp/ClientEvent.ts +0 -2395
- package/src/call-diagnostic/generated-types-temp/Event.ts +0 -7762
- package/src/call-diagnostic/generated-types-temp/MediaQualityEvent.ts +0 -2321
package/dist/new-metrics.js
CHANGED
|
@@ -8,6 +8,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
11
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
12
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
13
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
@@ -180,6 +181,70 @@ var Metrics = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
|
|
184
|
+
/**
|
|
185
|
+
* Submit a pre-login metric to clientmetrics
|
|
186
|
+
* @public
|
|
187
|
+
* @param payload
|
|
188
|
+
* @param preLoginId - pre-login ID of user
|
|
189
|
+
* @returns
|
|
190
|
+
*/
|
|
191
|
+
}, {
|
|
192
|
+
key: "postPreLoginMetric",
|
|
193
|
+
value: function postPreLoginMetric(payload, preLoginId) {
|
|
194
|
+
var _this3 = this;
|
|
195
|
+
// @ts-ignore
|
|
196
|
+
return this.webex.request({
|
|
197
|
+
method: 'POST',
|
|
198
|
+
api: 'metrics',
|
|
199
|
+
resource: 'clientmetrics-prelogin',
|
|
200
|
+
headers: {
|
|
201
|
+
authorization: false,
|
|
202
|
+
'x-prelogin-userid': preLoginId
|
|
203
|
+
},
|
|
204
|
+
body: payload
|
|
205
|
+
}).then(function (res) {
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
_this3.webex.logger.log("NewMetrics: @postPreLoginMetric. Request successful:", res);
|
|
208
|
+
return res;
|
|
209
|
+
}).catch(function (err) {
|
|
210
|
+
// @ts-ignore
|
|
211
|
+
_this3.logger.error("NewMetrics: @postPreLoginMetric. Request failed:", err);
|
|
212
|
+
return _promise.default.reject(err);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Issue request to alias a user's pre-login ID with their CI UUID
|
|
218
|
+
* @param {string} preLoginId
|
|
219
|
+
* @returns {Object} HttpResponse object
|
|
220
|
+
*/
|
|
221
|
+
}, {
|
|
222
|
+
key: "clientMetricsAliasUser",
|
|
223
|
+
value: function clientMetricsAliasUser(preLoginId) {
|
|
224
|
+
var _this4 = this;
|
|
225
|
+
// @ts-ignore
|
|
226
|
+
return this.webex.request({
|
|
227
|
+
method: 'POST',
|
|
228
|
+
api: 'metrics',
|
|
229
|
+
resource: 'clientmetrics',
|
|
230
|
+
headers: {
|
|
231
|
+
'x-prelogin-userid': preLoginId
|
|
232
|
+
},
|
|
233
|
+
body: {},
|
|
234
|
+
qs: {
|
|
235
|
+
alias: true
|
|
236
|
+
}
|
|
237
|
+
}).then(function (res) {
|
|
238
|
+
// @ts-ignore
|
|
239
|
+
_this4.webex.logger.log("NewMetrics: @clientMetricsAliasUser. Request successful:", res);
|
|
240
|
+
return res;
|
|
241
|
+
}).catch(function (err) {
|
|
242
|
+
// @ts-ignore
|
|
243
|
+
_this4.logger.error("NewMetrics: @clientMetricsAliasUser. Request failed:", err);
|
|
244
|
+
return _promise.default.reject(err);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
183
248
|
/**
|
|
184
249
|
* Returns a promise that will resolve to fetch options for submitting a metric.
|
|
185
250
|
*
|
package/dist/new-metrics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Metrics","args","onReady","webex","once","callDiagnosticMetrics","CallDiagnosticMetrics","parent","callDiagnosticLatencies","CallDiagnosticLatencies","name","payload","options","clearTimestamps","saveTimestamp","key","Error","submitMQE","meetingId","submitClientEvent","buildClientEventFetchRequestOptions","setTimingsAndFetch","setMetricTimings","WebexPlugin"],"sources":["new-metrics.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\n\n// @ts-ignore\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport CallDiagnosticMetrics from './call-diagnostic/call-diagnostic-metrics';\nimport {\n RecursivePartial,\n ClientEvent,\n FeatureEvent,\n BehavioralEvent,\n OperationalEvent,\n MediaQualityEvent,\n InternalEvent,\n SubmitClientEventOptions,\n} from './metrics.types';\nimport CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';\nimport {setMetricTimings} from './call-diagnostic/call-diagnostic-metrics.util';\n\n/**\n * Metrics plugin to centralize all types of metrics.\n * @class\n */\nclass Metrics extends WebexPlugin {\n // eslint-disable-next-line no-use-before-define\n static instance: Metrics;\n\n // Call Diagnostic latencies\n callDiagnosticLatencies: CallDiagnosticLatencies;\n // Helper classes to handle the different types of metrics\n callDiagnosticMetrics: CallDiagnosticMetrics;\n\n /**\n * Constructor\n * @param args\n * @constructor\n * @private\n * @returns\n */\n constructor(...args) {\n super(...args);\n\n this.onReady();\n }\n\n /**\n * On Ready\n */\n private onReady() {\n // @ts-ignore\n this.webex.once('ready', () => {\n // @ts-ignore\n this.callDiagnosticMetrics = new CallDiagnosticMetrics({}, {parent: this.webex});\n // @ts-ignore\n this.callDiagnosticLatencies = new CallDiagnosticLatencies({}, {parent: this.webex});\n });\n }\n\n /**\n * Used for internal purposes only\n * @param args\n */\n submitInternalEvent({\n name,\n payload,\n options,\n }: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n }) {\n if (name === 'internal.reset.join.latencies') {\n this.callDiagnosticLatencies.clearTimestamps();\n } else {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n }\n }\n\n /**\n * Behavioral event\n * @param args\n */\n submitBehavioralEvent({\n name,\n payload,\n options,\n }: {\n name: BehavioralEvent['name'];\n payload?: RecursivePartial<BehavioralEvent['payload']>;\n options?: any;\n }) {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n throw new Error('Not implemented.');\n }\n\n /**\n * Operational event\n * @param args\n */\n submitOperationalEvent({\n name,\n payload,\n options,\n }: {\n name: OperationalEvent['name'];\n payload?: RecursivePartial<OperationalEvent['payload']>;\n options?: any;\n }) {\n throw new Error('Not implemented.');\n }\n\n /**\n * Call Analyzer: Media Quality Event\n * @param args\n */\n submitMQE({\n name,\n payload,\n options,\n }: {\n name: MediaQualityEvent['name'];\n payload: RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: MediaQualityEvent['payload']['intervals'];\n };\n options: any;\n }) {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n this.callDiagnosticMetrics.submitMQE({name, payload, options});\n }\n\n /**\n * Call Analyzer: Feature Usage Event\n * @param args\n */\n submitFeatureEvent({\n name,\n payload,\n options,\n }: {\n name: FeatureEvent['name'];\n payload?: RecursivePartial<FeatureEvent['payload']>;\n options: any;\n }) {\n throw new Error('Not implemented.');\n }\n\n /**\n * Call Analyzer: Client Event\n * @public\n * @param args\n */\n public submitClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n this.callDiagnosticLatencies.saveTimestamp({\n key: name,\n options: {meetingId: options?.meetingId},\n });\n\n return this.callDiagnosticMetrics.submitClientEvent({name, payload, options});\n }\n\n /**\n * Returns a promise that will resolve to fetch options for submitting a metric.\n *\n * This is to support quickly submitting metrics when the browser/tab is closing.\n * Calling submitClientEvent will not work because there some async steps that will\n * not complete before the browser is closed. Instead, we pre-gather all the\n * information/options needed for the request(s), and then simply and quickly\n * fire the fetch(es) when beforeUnload is triggered.\n *\n * We must use fetch instead of request because fetch has a keepalive option that\n * allows the request it to outlive the page.\n *\n * Note: the timings values will be wrong, but setMetricTimingsAndFetch() will\n * properly adjust them before submitting.\n *\n * @public\n * @param {Object} arg\n * @param {String} arg.name - event name\n * @param {Object} arg.payload - event payload\n * @param {Object} arg.options - other options\n * @returns {Promise} promise that resolves to options to be used with fetch\n */\n public async buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n return this.callDiagnosticMetrics.buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n });\n }\n\n /**\n * Submits a metric from pre-built request options via the fetch API. Updates\n * the \"$timings\" and \"originTime\" values to Date.now() since the existing times\n * were set when the options were built (not submitted).\n\n * @param {any} options - the pre-built request options for submitting a metric\n * @returns {Promise} promise that resolves to the response object\n */\n public setMetricTimingsAndFetch(options: any): Promise<any> {\n // @ts-ignore\n return this.webex.setTimingsAndFetch(setMetricTimings(options));\n }\n}\n\nexport default Metrics;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA;AAEA;AAWA;AACA;AAAgF;AAAA;AAEhF;AACA;AACA;AACA;AAHA,IAIMA,OAAO;EAAA;EAAA;EACX;;EAGA;;EAEA;;EAGA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,mBAAqB;IAAA;IAAA;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IACjB,gDAASA,IAAI;IAAE;IAAA;IAEf,MAAKC,OAAO,EAAE;IAAC;EACjB;;EAEA;AACF;AACA;EAFE;IAAA;IAAA,OAGA,mBAAkB;MAAA;MAChB;MACA,IAAI,CAACC,KAAK,CAACC,IAAI,CAAC,OAAO,EAAE,YAAM;QAC7B;QACA,MAAI,CAACC,qBAAqB,GAAG,IAAIC,8BAAqB,CAAC,CAAC,CAAC,EAAE;UAACC,MAAM,EAAE,MAAI,CAACJ;QAAK,C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AAA,OAQA,kCAAgCA,OAAY,EAAgB;MAC1D;MACA,OAAO,IAAI,CAACT,KAAK,CAACkB,kBAAkB,CAAC,IAAAC,wCAAgB,EAACV,OAAO,CAAC,CAAC;IACjE;EAAC;EAAA;AAAA,EAlMmBW,sBAAW;AAAA,8BAA3BvB,OAAO;AAAA,eAqMEA,OAAO;AAAA"}
|
|
1
|
+
{"version":3,"names":["Metrics","args","onReady","webex","once","callDiagnosticMetrics","CallDiagnosticMetrics","parent","callDiagnosticLatencies","CallDiagnosticLatencies","name","payload","options","clearTimestamps","saveTimestamp","key","Error","submitMQE","meetingId","submitClientEvent","preLoginId","request","method","api","resource","headers","authorization","body","then","res","logger","log","catch","err","error","reject","qs","alias","buildClientEventFetchRequestOptions","setTimingsAndFetch","setMetricTimings","WebexPlugin"],"sources":["new-metrics.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\n\n// @ts-ignore\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport CallDiagnosticMetrics from './call-diagnostic/call-diagnostic-metrics';\nimport {\n RecursivePartial,\n ClientEvent,\n FeatureEvent,\n BehavioralEvent,\n OperationalEvent,\n MediaQualityEvent,\n InternalEvent,\n SubmitClientEventOptions,\n} from './metrics.types';\nimport CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';\nimport {setMetricTimings} from './call-diagnostic/call-diagnostic-metrics.util';\n\n/**\n * Metrics plugin to centralize all types of metrics.\n * @class\n */\nclass Metrics extends WebexPlugin {\n // eslint-disable-next-line no-use-before-define\n static instance: Metrics;\n\n // Call Diagnostic latencies\n callDiagnosticLatencies: CallDiagnosticLatencies;\n // Helper classes to handle the different types of metrics\n callDiagnosticMetrics: CallDiagnosticMetrics;\n\n /**\n * Constructor\n * @param args\n * @constructor\n * @private\n * @returns\n */\n constructor(...args) {\n super(...args);\n\n this.onReady();\n }\n\n /**\n * On Ready\n */\n private onReady() {\n // @ts-ignore\n this.webex.once('ready', () => {\n // @ts-ignore\n this.callDiagnosticMetrics = new CallDiagnosticMetrics({}, {parent: this.webex});\n // @ts-ignore\n this.callDiagnosticLatencies = new CallDiagnosticLatencies({}, {parent: this.webex});\n });\n }\n\n /**\n * Used for internal purposes only\n * @param args\n */\n submitInternalEvent({\n name,\n payload,\n options,\n }: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n }) {\n if (name === 'internal.reset.join.latencies') {\n this.callDiagnosticLatencies.clearTimestamps();\n } else {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n }\n }\n\n /**\n * Behavioral event\n * @param args\n */\n submitBehavioralEvent({\n name,\n payload,\n options,\n }: {\n name: BehavioralEvent['name'];\n payload?: RecursivePartial<BehavioralEvent['payload']>;\n options?: any;\n }) {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n throw new Error('Not implemented.');\n }\n\n /**\n * Operational event\n * @param args\n */\n submitOperationalEvent({\n name,\n payload,\n options,\n }: {\n name: OperationalEvent['name'];\n payload?: RecursivePartial<OperationalEvent['payload']>;\n options?: any;\n }) {\n throw new Error('Not implemented.');\n }\n\n /**\n * Call Analyzer: Media Quality Event\n * @param args\n */\n submitMQE({\n name,\n payload,\n options,\n }: {\n name: MediaQualityEvent['name'];\n payload: RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: MediaQualityEvent['payload']['intervals'];\n };\n options: any;\n }) {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n this.callDiagnosticMetrics.submitMQE({name, payload, options});\n }\n\n /**\n * Call Analyzer: Feature Usage Event\n * @param args\n */\n submitFeatureEvent({\n name,\n payload,\n options,\n }: {\n name: FeatureEvent['name'];\n payload?: RecursivePartial<FeatureEvent['payload']>;\n options: any;\n }) {\n throw new Error('Not implemented.');\n }\n\n /**\n * Call Analyzer: Client Event\n * @public\n * @param args\n */\n public submitClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n this.callDiagnosticLatencies.saveTimestamp({\n key: name,\n options: {meetingId: options?.meetingId},\n });\n\n return this.callDiagnosticMetrics.submitClientEvent({name, payload, options});\n }\n\n /**\n * Submit a pre-login metric to clientmetrics\n * @public\n * @param payload\n * @param preLoginId - pre-login ID of user\n * @returns\n */\n public postPreLoginMetric(payload: any, preLoginId: string): Promise<any> {\n // @ts-ignore\n return this.webex\n .request({\n method: 'POST',\n api: 'metrics',\n resource: 'clientmetrics-prelogin',\n headers: {\n authorization: false,\n 'x-prelogin-userid': preLoginId,\n },\n body: payload,\n })\n .then((res) => {\n // @ts-ignore\n this.webex.logger.log(`NewMetrics: @postPreLoginMetric. Request successful:`, res);\n\n return res;\n })\n .catch((err) => {\n // @ts-ignore\n this.logger.error(`NewMetrics: @postPreLoginMetric. Request failed:`, err);\n\n return Promise.reject(err);\n });\n }\n\n /**\n * Issue request to alias a user's pre-login ID with their CI UUID\n * @param {string} preLoginId\n * @returns {Object} HttpResponse object\n */\n public clientMetricsAliasUser(preLoginId: string) {\n // @ts-ignore\n return this.webex\n .request({\n method: 'POST',\n api: 'metrics',\n resource: 'clientmetrics',\n headers: {\n 'x-prelogin-userid': preLoginId,\n },\n body: {},\n qs: {\n alias: true,\n },\n })\n .then((res) => {\n // @ts-ignore\n this.webex.logger.log(`NewMetrics: @clientMetricsAliasUser. Request successful:`, res);\n\n return res;\n })\n .catch((err) => {\n // @ts-ignore\n this.logger.error(`NewMetrics: @clientMetricsAliasUser. Request failed:`, err);\n\n return Promise.reject(err);\n });\n }\n\n /**\n * Returns a promise that will resolve to fetch options for submitting a metric.\n *\n * This is to support quickly submitting metrics when the browser/tab is closing.\n * Calling submitClientEvent will not work because there some async steps that will\n * not complete before the browser is closed. Instead, we pre-gather all the\n * information/options needed for the request(s), and then simply and quickly\n * fire the fetch(es) when beforeUnload is triggered.\n *\n * We must use fetch instead of request because fetch has a keepalive option that\n * allows the request it to outlive the page.\n *\n * Note: the timings values will be wrong, but setMetricTimingsAndFetch() will\n * properly adjust them before submitting.\n *\n * @public\n * @param {Object} arg\n * @param {String} arg.name - event name\n * @param {Object} arg.payload - event payload\n * @param {Object} arg.options - other options\n * @returns {Promise} promise that resolves to options to be used with fetch\n */\n public async buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n return this.callDiagnosticMetrics.buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n });\n }\n\n /**\n * Submits a metric from pre-built request options via the fetch API. Updates\n * the \"$timings\" and \"originTime\" values to Date.now() since the existing times\n * were set when the options were built (not submitted).\n\n * @param {any} options - the pre-built request options for submitting a metric\n * @returns {Promise} promise that resolves to the response object\n */\n public setMetricTimingsAndFetch(options: any): Promise<any> {\n // @ts-ignore\n return this.webex.setTimingsAndFetch(setMetricTimings(options));\n }\n}\n\nexport default Metrics;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA;AAEA;AAWA;AACA;AAAgF;AAAA;AAEhF;AACA;AACA;AACA;AAHA,IAIMA,OAAO;EAAA;EAAA;EACX;;EAGA;;EAEA;;EAGA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,mBAAqB;IAAA;IAAA;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IACjB,gDAASA,IAAI;IAAE;IAAA;IAEf,MAAKC,OAAO,EAAE;IAAC;EACjB;;EAEA;AACF;AACA;EAFE;IAAA;IAAA,OAGA,mBAAkB;MAAA;MAChB;MACA,IAAI,CAACC,KAAK,CAACC,IAAI,CAAC,OAAO,EAAE,YAAM;QAC7B;QACA,MAAI,CAACC,qBAAqB,GAAG,IAAIC,8BAAqB,CAAC,CAAC,CAAC,EAAE;UAACC,MAAM,EAAE,MAAI,CAACJ;QAAK,CAAC,CAAC;QAChF;QACA,MAAI,CAACK,uBAA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AAA;MAAA;MAAA;IAAA;IAED;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAQA,kCAAgCA,OAAY,EAAgB;MAC1D;MACA,OAAO,IAAI,CAACT,KAAK,CAACoC,kBAAkB,CAAC,IAAAC,wCAAgB,EAAC5B,OAAO,CAAC,CAAC;IACjE;EAAC;EAAA;AAAA,EAtQmB6B,sBAAW;AAAA,8BAA3BzC,OAAO;AAAA,eAyQEA,OAAO;AAAA"}
|
|
@@ -17,6 +17,7 @@ type GetIdentifiersOptions = {
|
|
|
17
17
|
*/
|
|
18
18
|
export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
19
19
|
private callDiagnosticEventsBatcher;
|
|
20
|
+
private logger;
|
|
20
21
|
/**
|
|
21
22
|
* Constructor
|
|
22
23
|
* @param args
|
|
@@ -26,7 +27,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
26
27
|
* Returns the login type of the current user
|
|
27
28
|
* @returns one of 'login-ci','unverified-guest', null
|
|
28
29
|
*/
|
|
29
|
-
getCurLoginType(): "
|
|
30
|
+
getCurLoginType(): "unverified-guest" | "login-ci";
|
|
30
31
|
/**
|
|
31
32
|
* Returns if the meeting has converged architecture enabled
|
|
32
33
|
* @param options.meetingId
|
|
@@ -41,30 +42,30 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
41
42
|
* @returns
|
|
42
43
|
*/
|
|
43
44
|
getOrigin(options: GetOriginOptions, meetingId?: string): {
|
|
44
|
-
name: "antares" | "beech" | "breakout" | "cb" | "cloudproxy" | "edonus" | "
|
|
45
|
+
name: "endpoint" | "antares" | "beech" | "breakout" | "cb" | "cloudproxy" | "edonus" | "givr" | "hecate" | "hedge" | "hesiod" | "homer" | "superhomer" | "l2sip" | "linus" | "locus" | "mcc" | "mcs" | "mercury" | "mes" | "mjs" | "mmp" | "mygdon" | "orpheus" | "page" | "poros" | "rhesos" | "terminus" | "tpgw" | "ucc" | "wdm" | "webexivr";
|
|
45
46
|
userAgent: string;
|
|
46
47
|
buildType?: "debug" | "test" | "prod" | "tap" | "analyzer-test";
|
|
47
48
|
upgradeChannel?: string;
|
|
48
49
|
instanceId?: string;
|
|
49
|
-
networkType: "
|
|
50
|
+
networkType: "wifi" | "ethernet" | "cellular" | "unknown";
|
|
50
51
|
localIP?: string;
|
|
51
52
|
usingProxy?: boolean;
|
|
52
53
|
mediaEngineSoftwareVersion?: string;
|
|
53
54
|
environment?: string;
|
|
54
55
|
newEnvironment?: string;
|
|
55
56
|
clientInfo?: {
|
|
56
|
-
os
|
|
57
|
-
osVersion
|
|
57
|
+
os?: "windows" | "mac" | "ios" | "android" | "chrome" | "linux" | "other" | "android-x64" | "uwp-arm64";
|
|
58
|
+
osVersion?: string;
|
|
58
59
|
localIP?: string;
|
|
59
60
|
gatewayIP?: string;
|
|
60
61
|
macAddress?: string;
|
|
61
62
|
localNetworkPrefix?: string;
|
|
62
63
|
publicNetworkPrefix?: string;
|
|
63
64
|
browserLaunchMethod?: "activex" | "npapi" | "extension" | "cwsapi" | "java" | "tfs" | "webacd" | "url-handler" | "thinclient";
|
|
64
|
-
clientLaunchMethod?: "url-handler" | "universal-link" | "voice-command" | "notification" | "
|
|
65
|
+
clientLaunchMethod?: "manual" | "url-handler" | "universal-link" | "voice-command" | "notification" | "teams-cross-launch" | "mc-cross-launch";
|
|
65
66
|
browser?: string;
|
|
66
67
|
browserVersion?: string;
|
|
67
|
-
clientType?: "
|
|
68
|
+
clientType?: "MEETING_CENTER" | "EVENT_CENTER" | "TRAINING_CENTER" | "TEAMS_CLIENT" | "TEAMS_DEVICE" | "TEAMS_SHARE" | "SIP" | "RECORDING" | "CLOUD_AWARE_SIP" | "TEAMS_WXC_CLIENT" | "WXC_CLIENT" | "WXC_DEVICE" | "WEBEX_JS_SDK" | "VOICEA_CLIENT" | "CISCO_SIP_GW" | "WEBEX_SDK" | "CPAAS_THIRD_PARTY_SDK" | "WXC_THIRD_PARTY" | "WXCC";
|
|
68
69
|
subClientType?: "DESKTOP_APP" | "DESKTOP_APP_VDI" | "DEVICE_CURRENT" | "DEVICE_LEGACY_2020" | "HVDI_APP" | "MOBILE_APP" | "VDI_APP" | "WEB_APP" | "MOBILE_NETWORK" | "HOLOGRAM_HEADSET_APP";
|
|
69
70
|
clientVersion?: string;
|
|
70
71
|
localClientVersion?: string;
|
|
@@ -92,21 +93,25 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
92
93
|
numberOfCores: number;
|
|
93
94
|
architecture: "unknown" | "intel32" | "intel64" | "amd32" | "amd64" | "arm32" | "arm64";
|
|
94
95
|
staticPerformance?: string;
|
|
96
|
+
additionalProperties?: false;
|
|
95
97
|
};
|
|
96
98
|
shareType?: "cb-normal-share" | "ce-airplay-share" | "ce-direct-share" | "ce-gui-loopback-share" | "ce-input-source-share" | "ce-input-source-share-hdmi" | "ce-input-source-share-usbc" | "ce-jpg-share" | "ce-miracast-share" | "mcs-normal-share" | "mcs-normal-audio-share" | "mcs-hfps-share" | "mcs-hfps-audio-share";
|
|
97
99
|
videoDisplayMode?: "grid-view" | "active-speaker-view";
|
|
98
100
|
videoLayoutType?: "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare";
|
|
99
101
|
videoRenderType?: "wme" | "client_d3d" | "client_gdi";
|
|
100
|
-
vdiInfo?:
|
|
102
|
+
vdiInfo?: {};
|
|
101
103
|
is64BitsClient?: boolean;
|
|
102
104
|
webexAppVersion?: string;
|
|
103
105
|
launch32BitsReason?: "forcewin32" | "disablewin64" | "platform_win32" | "platform_arm" | "platform_unknown" | "version_below_41.11";
|
|
104
106
|
inMeetingUpdate?: boolean;
|
|
105
107
|
mtaVersion?: string;
|
|
106
108
|
isWarholOpening?: boolean;
|
|
109
|
+
additionalProperties?: false;
|
|
107
110
|
};
|
|
111
|
+
emmVendorId?: string;
|
|
108
112
|
isHybridMedia?: boolean;
|
|
109
113
|
originData?: {};
|
|
114
|
+
additionalProperties?: false;
|
|
110
115
|
};
|
|
111
116
|
/**
|
|
112
117
|
* Gather identifier details for call diagnostic payload.
|
|
@@ -126,6 +131,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
126
131
|
imiAppId: string;
|
|
127
132
|
sessionId: string;
|
|
128
133
|
sessionInstanceId: string;
|
|
134
|
+
additionalProperties?: false;
|
|
129
135
|
};
|
|
130
136
|
csdmDeviceUrl?: string;
|
|
131
137
|
destinationBreakoutSessionId?: string;
|
|
@@ -136,6 +142,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
136
142
|
ivrCallId?: string;
|
|
137
143
|
ivrDialogId?: string;
|
|
138
144
|
ivrId?: string;
|
|
145
|
+
callId?: string;
|
|
139
146
|
locusId?: string;
|
|
140
147
|
locusSessionId?: string;
|
|
141
148
|
locusStartTime?: string;
|
|
@@ -149,11 +156,13 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
149
156
|
msteamsConferenceId?: string;
|
|
150
157
|
oauth2ClientId?: string;
|
|
151
158
|
orgId?: string;
|
|
159
|
+
provisionalCorrelationId?: string;
|
|
152
160
|
roomId?: string;
|
|
153
161
|
sipCallId?: string;
|
|
154
162
|
sipSessionId?: {
|
|
155
163
|
local?: string;
|
|
156
164
|
remote?: string;
|
|
165
|
+
additionalProperties?: false;
|
|
157
166
|
};
|
|
158
167
|
sipUri?: string;
|
|
159
168
|
subConfId?: string;
|
|
@@ -175,6 +184,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
175
184
|
webexUserId?: number;
|
|
176
185
|
webexWebDomain?: string;
|
|
177
186
|
correlationId: string;
|
|
187
|
+
additionalProperties?: false;
|
|
178
188
|
} | {
|
|
179
189
|
attendeeId?: string;
|
|
180
190
|
breakoutGroupId?: string;
|
|
@@ -188,6 +198,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
188
198
|
imiAppId: string;
|
|
189
199
|
sessionId: string;
|
|
190
200
|
sessionInstanceId: string;
|
|
201
|
+
additionalProperties?: false;
|
|
191
202
|
};
|
|
192
203
|
csdmDeviceUrl?: string;
|
|
193
204
|
destinationBreakoutSessionId?: string;
|
|
@@ -198,6 +209,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
198
209
|
ivrCallId?: string;
|
|
199
210
|
ivrDialogId?: string;
|
|
200
211
|
ivrId?: string;
|
|
212
|
+
callId?: string;
|
|
201
213
|
locusId?: string;
|
|
202
214
|
locusSessionId?: string;
|
|
203
215
|
locusStartTime?: string;
|
|
@@ -217,6 +229,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
217
229
|
sipSessionId?: {
|
|
218
230
|
local?: string;
|
|
219
231
|
remote?: string;
|
|
232
|
+
additionalProperties?: false;
|
|
220
233
|
};
|
|
221
234
|
sipUri?: string;
|
|
222
235
|
subConfId?: string;
|
|
@@ -238,6 +251,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
238
251
|
webexUserId?: number;
|
|
239
252
|
webexWebDomain?: string;
|
|
240
253
|
correlationId: string;
|
|
254
|
+
additionalProperties?: false;
|
|
241
255
|
};
|
|
242
256
|
/**
|
|
243
257
|
* Create diagnostic event, which can hold client event, feature event or MQE event data.
|
|
@@ -288,10 +302,12 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
288
302
|
errorCode?: number;
|
|
289
303
|
errorCodeStr?: string;
|
|
290
304
|
httpCode?: number;
|
|
305
|
+
errorCodeExt1?: number;
|
|
291
306
|
errorData?: {};
|
|
292
307
|
shownToUser: boolean;
|
|
293
308
|
serviceErrorCode?: number;
|
|
294
|
-
name: "other" | "media-engine" | "ice.failed" | "locus.
|
|
309
|
+
name: "other" | "locus.response" | "media-engine" | "ice.failed" | "locus.leave" | "client.leave" | "media-device" | "media-sca" | "wxc";
|
|
310
|
+
additionalProperties?: false;
|
|
295
311
|
};
|
|
296
312
|
/**
|
|
297
313
|
* Create client event object for in meeting events
|
|
@@ -338,6 +354,13 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
338
354
|
* @returns promise
|
|
339
355
|
*/
|
|
340
356
|
submitToCallDiagnostics(event: Event): Promise<any>;
|
|
357
|
+
/**
|
|
358
|
+
* Pre login events are not batched. We make the request directly.
|
|
359
|
+
* @param event
|
|
360
|
+
* @param preLoginId
|
|
361
|
+
* @returns
|
|
362
|
+
*/
|
|
363
|
+
submitToCallDiagnosticsPreLogin: (event: Event, preLoginId?: string) => Promise<any>;
|
|
341
364
|
/**
|
|
342
365
|
* Builds a request options object to later be passed to fetch().
|
|
343
366
|
* @param arg - submit params
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientEventError } from '../metrics.types';
|
|
2
|
+
export declare const CALL_DIAGNOSTIC_LOG_IDENTIFIER = "call-diagnostic-events -> ";
|
|
2
3
|
export declare const NEW_LOCUS_ERROR_CLIENT_CODE = 4008;
|
|
3
4
|
export declare const MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE = 4100;
|
|
4
5
|
export declare const UNKNOWN_ERROR = 9999;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { ClientEvent as RawClientEvent } from '
|
|
2
|
-
import { Event as RawEvent } from './call-diagnostic/generated-types-temp/Event';
|
|
3
|
-
import { MediaQualityEvent as RawMediaQualityEvent } from './call-diagnostic/generated-types-temp/MediaQualityEvent';
|
|
1
|
+
import { ClientEvent as RawClientEvent, Event as RawEvent, MediaQualityEvent as RawMediaQualityEvent } from '@webex/event-dictionary-ts';
|
|
4
2
|
export type Event = Omit<RawEvent, 'event'> & {
|
|
5
3
|
event: RawClientEvent | RawMediaQualityEvent;
|
|
6
4
|
};
|
|
@@ -11,6 +9,7 @@ export type SubmitClientEventOptions = {
|
|
|
11
9
|
rawError?: any;
|
|
12
10
|
showToUser?: boolean;
|
|
13
11
|
correlationId?: string;
|
|
12
|
+
preLoginId?: string;
|
|
14
13
|
};
|
|
15
14
|
export type SubmitMQEOptions = {
|
|
16
15
|
meetingId: string;
|
|
@@ -79,6 +79,20 @@ declare class Metrics extends WebexPlugin {
|
|
|
79
79
|
payload?: RecursivePartial<ClientEvent['payload']>;
|
|
80
80
|
options?: SubmitClientEventOptions;
|
|
81
81
|
}): Promise<any>;
|
|
82
|
+
/**
|
|
83
|
+
* Submit a pre-login metric to clientmetrics
|
|
84
|
+
* @public
|
|
85
|
+
* @param payload
|
|
86
|
+
* @param preLoginId - pre-login ID of user
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
postPreLoginMetric(payload: any, preLoginId: string): Promise<any>;
|
|
90
|
+
/**
|
|
91
|
+
* Issue request to alias a user's pre-login ID with their CI UUID
|
|
92
|
+
* @param {string} preLoginId
|
|
93
|
+
* @returns {Object} HttpResponse object
|
|
94
|
+
*/
|
|
95
|
+
clientMetricsAliasUser(preLoginId: string): any;
|
|
82
96
|
/**
|
|
83
97
|
* Returns a promise that will resolve to fetch options for submitting a metric.
|
|
84
98
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-metrics",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.223",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,18 +22,19 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@sinonjs/fake-timers": "^6.0.1",
|
|
25
|
+
"@webex/event-dictionary-ts": "^1.0.1237",
|
|
25
26
|
"sinon": "^9.2.4"
|
|
26
27
|
},
|
|
27
28
|
"scripts": {
|
|
28
29
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@webex/common": "3.0.0-beta.
|
|
32
|
-
"@webex/common-timers": "3.0.0-beta.
|
|
33
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
34
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
35
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
37
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
32
|
+
"@webex/common": "3.0.0-beta.223",
|
|
33
|
+
"@webex/common-timers": "3.0.0-beta.223",
|
|
34
|
+
"@webex/internal-plugin-device": "3.0.0-beta.223",
|
|
35
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.223",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.223",
|
|
37
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.223",
|
|
38
|
+
"@webex/webex-core": "3.0.0-beta.223"
|
|
38
39
|
}
|
|
39
40
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/* eslint-disable class-methods-use-this */
|
|
2
2
|
/* eslint-disable valid-jsdoc */
|
|
3
3
|
|
|
4
|
+
import {uniqueId} from 'lodash';
|
|
4
5
|
import Batcher from '../batcher';
|
|
5
6
|
import {prepareDiagnosticMetricItem} from './call-diagnostic-metrics.util';
|
|
7
|
+
import {CALL_DIAGNOSTIC_LOG_IDENTIFIER} from './config';
|
|
6
8
|
|
|
7
9
|
const CallDiagnosticEventsBatcher = Batcher.extend({
|
|
8
10
|
namespace: 'Metrics',
|
|
@@ -37,14 +39,40 @@ const CallDiagnosticEventsBatcher = Batcher.extend({
|
|
|
37
39
|
* @returns
|
|
38
40
|
*/
|
|
39
41
|
submitHttpRequest(payload) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const batchId = uniqueId('call-diagnostic-metrics-batch-');
|
|
43
|
+
this.webex.logger.log(
|
|
44
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
45
|
+
`CallDiagnosticEventsBatcher: @submitHttpRequest#${batchId}. Sending the request:`,
|
|
46
|
+
payload
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return this.webex
|
|
50
|
+
.request({
|
|
51
|
+
method: 'POST',
|
|
52
|
+
service: 'metrics',
|
|
53
|
+
resource: 'clientmetrics',
|
|
54
|
+
body: {
|
|
55
|
+
metrics: payload,
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
.then((res) => {
|
|
59
|
+
this.webex.logger.log(
|
|
60
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
61
|
+
`CallDiagnosticEventsBatcher: @submitHttpRequest#${batchId}. Request successful:`,
|
|
62
|
+
res
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
return res;
|
|
66
|
+
})
|
|
67
|
+
.catch((err) => {
|
|
68
|
+
this.webex.logger.error(
|
|
69
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
70
|
+
`CallDiagnosticEventsBatcher: @submitHttpRequest#${batchId}. Request failed:`,
|
|
71
|
+
err
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return Promise.reject(err);
|
|
75
|
+
});
|
|
48
76
|
},
|
|
49
77
|
});
|
|
50
78
|
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
} from './call-diagnostic-metrics.util';
|
|
20
20
|
import {CLIENT_NAME} from '../config';
|
|
21
21
|
import {
|
|
22
|
-
RecursivePartial,
|
|
23
22
|
Event,
|
|
24
23
|
ClientType,
|
|
25
24
|
SubClientType,
|
|
@@ -43,6 +42,7 @@ import {
|
|
|
43
42
|
UNKNOWN_ERROR,
|
|
44
43
|
BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP,
|
|
45
44
|
MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,
|
|
45
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
46
46
|
} from './config';
|
|
47
47
|
|
|
48
48
|
const {getOSVersion, getBrowserName, getBrowserVersion} = BrowserDetection();
|
|
@@ -67,6 +67,7 @@ type GetIdentifiersOptions = {
|
|
|
67
67
|
export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
68
68
|
// @ts-ignore
|
|
69
69
|
private callDiagnosticEventsBatcher: CallDiagnosticEventsBatcher;
|
|
70
|
+
private logger: any; // to avoid adding @ts-ignore everywhere
|
|
70
71
|
|
|
71
72
|
/**
|
|
72
73
|
* Constructor
|
|
@@ -75,6 +76,8 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
75
76
|
constructor(...args) {
|
|
76
77
|
super(...args);
|
|
77
78
|
// @ts-ignore
|
|
79
|
+
this.logger = this.webex.logger;
|
|
80
|
+
// @ts-ignore
|
|
78
81
|
this.callDiagnosticEventsBatcher = new CallDiagnosticEventsBatcher({}, {parent: this.webex});
|
|
79
82
|
}
|
|
80
83
|
|
|
@@ -444,7 +447,12 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
444
447
|
options?: SubmitClientEventOptions;
|
|
445
448
|
errors?: ClientEventPayloadError;
|
|
446
449
|
}) {
|
|
447
|
-
|
|
450
|
+
this.logger.log(
|
|
451
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
452
|
+
'CallDiagnosticMetrics: @prepareClientEvent. Creating in meeting event object.',
|
|
453
|
+
name
|
|
454
|
+
);
|
|
455
|
+
const {meetingId, mediaConnections, rawError} = options;
|
|
448
456
|
|
|
449
457
|
// @ts-ignore
|
|
450
458
|
const meeting = this.webex.meetings.meetingCollection.get(meetingId);
|
|
@@ -506,6 +514,11 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
506
514
|
options?: SubmitClientEventOptions;
|
|
507
515
|
errors?: ClientEventPayloadError;
|
|
508
516
|
}) {
|
|
517
|
+
this.logger.log(
|
|
518
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
519
|
+
'CallDiagnosticMetrics: @createClientEventObjectPreMeeting. Creating pre meeting event object.',
|
|
520
|
+
name
|
|
521
|
+
);
|
|
509
522
|
const {correlationId} = options;
|
|
510
523
|
|
|
511
524
|
// grab identifiers
|
|
@@ -553,10 +566,22 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
553
566
|
const errors: ClientEventPayloadError = [];
|
|
554
567
|
|
|
555
568
|
if (rawError) {
|
|
569
|
+
this.logger.log(
|
|
570
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
571
|
+
'CallDiagnosticMetrics: @prepareClientEvent. Error detected, attempting to map and attach it to the event...',
|
|
572
|
+
name,
|
|
573
|
+
rawError
|
|
574
|
+
);
|
|
575
|
+
|
|
556
576
|
const generatedError = this.generateClientEventErrorPayload(rawError);
|
|
557
577
|
if (generatedError) {
|
|
558
578
|
errors.push(generatedError);
|
|
559
579
|
}
|
|
580
|
+
this.logger.log(
|
|
581
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
582
|
+
'CallDiagnosticMetrics: @prepareClientEvent. Generated errors:',
|
|
583
|
+
generatedError
|
|
584
|
+
);
|
|
560
585
|
}
|
|
561
586
|
|
|
562
587
|
// events that will most likely happen in join phase
|
|
@@ -595,8 +620,19 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
595
620
|
payload?: ClientEventPayload;
|
|
596
621
|
options?: SubmitClientEventOptions;
|
|
597
622
|
}) {
|
|
623
|
+
this.logger.log(
|
|
624
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
625
|
+
'CallDiagnosticMetrics: @submitClientEvent. Submit Client Event CA event.',
|
|
626
|
+
name,
|
|
627
|
+
payload,
|
|
628
|
+
options
|
|
629
|
+
);
|
|
598
630
|
const diagnosticEvent = this.prepareClientEvent({name, payload, options});
|
|
599
631
|
|
|
632
|
+
if (options?.preLoginId) {
|
|
633
|
+
return this.submitToCallDiagnosticsPreLogin(diagnosticEvent, options?.preLoginId);
|
|
634
|
+
}
|
|
635
|
+
|
|
600
636
|
return this.submitToCallDiagnostics(diagnosticEvent);
|
|
601
637
|
}
|
|
602
638
|
|
|
@@ -612,9 +648,42 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
612
648
|
type: ['diagnostic-event'],
|
|
613
649
|
};
|
|
614
650
|
|
|
651
|
+
this.logger.log(
|
|
652
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
653
|
+
'CallDiagnosticMetrics: @submitToCallDiagnostics. Preparing to send the request',
|
|
654
|
+
finalEvent
|
|
655
|
+
);
|
|
656
|
+
|
|
615
657
|
return this.callDiagnosticEventsBatcher.request(finalEvent);
|
|
616
658
|
}
|
|
617
659
|
|
|
660
|
+
/**
|
|
661
|
+
* Pre login events are not batched. We make the request directly.
|
|
662
|
+
* @param event
|
|
663
|
+
* @param preLoginId
|
|
664
|
+
* @returns
|
|
665
|
+
*/
|
|
666
|
+
public submitToCallDiagnosticsPreLogin = (event: Event, preLoginId?: string): Promise<any> => {
|
|
667
|
+
// build metrics-a event type
|
|
668
|
+
// @ts-ignore
|
|
669
|
+
const diagnosticEvent = prepareDiagnosticMetricItem(this.webex, {
|
|
670
|
+
eventPayload: event,
|
|
671
|
+
type: ['diagnostic-event'],
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
// append sent timestamp
|
|
675
|
+
diagnosticEvent.eventPayload.originTime.sent = new Date().toISOString();
|
|
676
|
+
|
|
677
|
+
this.logger.log(
|
|
678
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
679
|
+
`CallDiagnosticMetrics: @submitToCallDiagnosticsPreLogin. Sending the request:`,
|
|
680
|
+
diagnosticEvent
|
|
681
|
+
);
|
|
682
|
+
|
|
683
|
+
// @ts-ignore
|
|
684
|
+
return this.webex.internal.newMetrics.postPreLoginMetric(diagnosticEvent, preLoginId);
|
|
685
|
+
};
|
|
686
|
+
|
|
618
687
|
/**
|
|
619
688
|
* Builds a request options object to later be passed to fetch().
|
|
620
689
|
* @param arg - submit params
|
|
@@ -633,6 +702,14 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
|
|
|
633
702
|
payload?: ClientEventPayload;
|
|
634
703
|
options?: SubmitClientEventOptions;
|
|
635
704
|
}): Promise<any> {
|
|
705
|
+
this.logger.log(
|
|
706
|
+
CALL_DIAGNOSTIC_LOG_IDENTIFIER,
|
|
707
|
+
'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...',
|
|
708
|
+
name,
|
|
709
|
+
payload,
|
|
710
|
+
options
|
|
711
|
+
);
|
|
712
|
+
|
|
636
713
|
const clientEvent = this.prepareClientEvent({name, payload, options});
|
|
637
714
|
|
|
638
715
|
// build metrics-a event type
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import {ClientEventError} from '../metrics.types';
|
|
6
6
|
|
|
7
|
+
export const CALL_DIAGNOSTIC_LOG_IDENTIFIER = 'call-diagnostic-events -> ';
|
|
8
|
+
|
|
7
9
|
export const NEW_LOCUS_ERROR_CLIENT_CODE = 4008;
|
|
8
10
|
export const MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE = 4100;
|
|
9
11
|
export const UNKNOWN_ERROR = 9999; // Unexpected error that is not a meetingInfo error, locus error or browser media error.
|
package/src/metrics.types.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
ClientEvent as RawClientEvent,
|
|
3
|
+
Event as RawEvent,
|
|
4
|
+
MediaQualityEvent as RawMediaQualityEvent,
|
|
5
|
+
} from '@webex/event-dictionary-ts';
|
|
4
6
|
|
|
5
7
|
export type Event = Omit<RawEvent, 'event'> & {event: RawClientEvent | RawMediaQualityEvent};
|
|
6
8
|
|
|
@@ -12,6 +14,7 @@ export type SubmitClientEventOptions = {
|
|
|
12
14
|
rawError?: any;
|
|
13
15
|
showToUser?: boolean;
|
|
14
16
|
correlationId?: string;
|
|
17
|
+
preLoginId?: string;
|
|
15
18
|
};
|
|
16
19
|
|
|
17
20
|
export type SubmitMQEOptions = {
|