@webex/internal-plugin-metrics 3.0.0-beta.17 → 3.0.0-beta.171

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 (67) hide show
  1. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +132 -0
  2. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
  3. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +339 -0
  4. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
  5. package/dist/call-diagnostic/call-diagnostic-metrics.js +511 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  7. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +106 -0
  8. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
  9. package/dist/call-diagnostic/config.js +461 -0
  10. package/dist/call-diagnostic/config.js.map +1 -0
  11. package/dist/call-diagnostic/generated-types-temp/ClientEvent.js +7 -0
  12. package/dist/call-diagnostic/generated-types-temp/ClientEvent.js.map +1 -0
  13. package/dist/call-diagnostic/generated-types-temp/Event.js +7 -0
  14. package/dist/call-diagnostic/generated-types-temp/Event.js.map +1 -0
  15. package/dist/call-diagnostic/generated-types-temp/MediaQualityEvent.js +7 -0
  16. package/dist/call-diagnostic/generated-types-temp/MediaQualityEvent.js.map +1 -0
  17. package/dist/config.js +20 -1
  18. package/dist/config.js.map +1 -1
  19. package/dist/index.js +25 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/metrics.js +30 -30
  22. package/dist/metrics.js.map +1 -1
  23. package/dist/metrics.types.js +7 -0
  24. package/dist/metrics.types.js.map +1 -0
  25. package/dist/new-metrics.js +171 -0
  26. package/dist/new-metrics.js.map +1 -0
  27. package/dist/types/batcher.d.ts +2 -0
  28. package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
  29. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +154 -0
  30. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +324 -0
  31. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +31 -0
  32. package/dist/types/call-diagnostic/config.d.ts +57 -0
  33. package/dist/types/call-diagnostic/generated-types-temp/ClientEvent.d.ts +1112 -0
  34. package/dist/types/call-diagnostic/generated-types-temp/Event.d.ts +4851 -0
  35. package/dist/types/call-diagnostic/generated-types-temp/MediaQualityEvent.d.ts +2121 -0
  36. package/dist/types/client-metrics-batcher.d.ts +2 -0
  37. package/dist/types/config.d.ts +35 -0
  38. package/dist/types/index.d.ts +11 -0
  39. package/dist/types/metrics.d.ts +3 -0
  40. package/dist/types/metrics.types.d.ts +87 -0
  41. package/dist/types/new-metrics.d.ts +83 -0
  42. package/package.json +12 -8
  43. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +146 -0
  44. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +308 -0
  45. package/src/call-diagnostic/call-diagnostic-metrics.ts +528 -0
  46. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +102 -0
  47. package/src/call-diagnostic/config.ts +455 -0
  48. package/src/call-diagnostic/generated-types-temp/ClientEvent.ts +2357 -0
  49. package/src/call-diagnostic/generated-types-temp/Event.ts +7669 -0
  50. package/src/call-diagnostic/generated-types-temp/MediaQualityEvent.ts +2321 -0
  51. package/src/config.js +19 -0
  52. package/src/index.ts +39 -0
  53. package/src/metrics.js +25 -27
  54. package/src/metrics.types.ts +132 -0
  55. package/src/new-metrics.ts +167 -0
  56. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +235 -0
  57. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +199 -0
  58. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +722 -0
  59. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +76 -0
  60. package/test/unit/spec/metrics.js +65 -97
  61. package/test/unit/spec/new-metrics.ts +88 -0
  62. package/tsconfig.json +6 -0
  63. package/dist/call-diagnostic-events-batcher.js +0 -60
  64. package/dist/call-diagnostic-events-batcher.js.map +0 -1
  65. package/src/call-diagnostic-events-batcher.js +0 -62
  66. package/src/index.js +0 -17
  67. package/test/unit/spec/call-diagnostic-events-batcher.js +0 -195
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+
3
+ var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
5
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
+ _Object$defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.default = void 0;
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
11
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
12
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
14
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
15
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
16
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
17
+ var _webexCore = require("@webex/webex-core");
18
+ var _callDiagnosticMetrics = _interopRequireDefault(require("./call-diagnostic/call-diagnostic-metrics"));
19
+ var _callDiagnosticMetricsLatencies = _interopRequireDefault(require("./call-diagnostic/call-diagnostic-metrics-latencies"));
20
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
21
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
+ /**
23
+ * Metrics plugin to centralize all types of metrics.
24
+ * @class
25
+ */
26
+ var Metrics = /*#__PURE__*/function (_WebexPlugin) {
27
+ (0, _inherits2.default)(Metrics, _WebexPlugin);
28
+ var _super = _createSuper(Metrics);
29
+ // eslint-disable-next-line no-use-before-define
30
+
31
+ // Call Diagnostic latencies
32
+
33
+ // Helper classes to handle the different types of metrics
34
+
35
+ /**
36
+ * Constructor
37
+ * @param args
38
+ * @constructor
39
+ * @private
40
+ * @returns
41
+ */
42
+ function Metrics() {
43
+ var _this;
44
+ (0, _classCallCheck2.default)(this, Metrics);
45
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
46
+ args[_key] = arguments[_key];
47
+ }
48
+ _this = _super.call.apply(_super, [this].concat(args));
49
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callDiagnosticLatencies", void 0);
50
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callDiagnosticMetrics", void 0);
51
+ _this.callDiagnosticLatencies = new _callDiagnosticMetricsLatencies.default();
52
+ _this.onReady();
53
+ return _this;
54
+ }
55
+
56
+ /**
57
+ * On Ready
58
+ */
59
+ (0, _createClass2.default)(Metrics, [{
60
+ key: "onReady",
61
+ value: function onReady() {
62
+ var _this2 = this;
63
+ // @ts-ignore
64
+ this.webex.once('ready', function () {
65
+ // @ts-ignore
66
+ _this2.callDiagnosticMetrics = new _callDiagnosticMetrics.default({}, {
67
+ parent: _this2.webex
68
+ });
69
+ });
70
+ }
71
+
72
+ /**
73
+ * Used for internal purposes only
74
+ * @param args
75
+ */
76
+ }, {
77
+ key: "submitInternalEvent",
78
+ value: function submitInternalEvent(_ref) {
79
+ var name = _ref.name,
80
+ payload = _ref.payload,
81
+ options = _ref.options;
82
+ if (name === 'internal.reset.join.latencies') {
83
+ this.callDiagnosticLatencies.clearTimestamps();
84
+ } else {
85
+ this.callDiagnosticLatencies.saveTimestamp(name);
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Behavioral event
91
+ * @param args
92
+ */
93
+ }, {
94
+ key: "submitBehavioralEvent",
95
+ value: function submitBehavioralEvent(_ref2) {
96
+ var name = _ref2.name,
97
+ payload = _ref2.payload,
98
+ options = _ref2.options;
99
+ this.callDiagnosticLatencies.saveTimestamp(name);
100
+ throw new Error('Not implemented.');
101
+ }
102
+
103
+ /**
104
+ * Operational event
105
+ * @param args
106
+ */
107
+ }, {
108
+ key: "submitOperationalEvent",
109
+ value: function submitOperationalEvent(_ref3) {
110
+ var name = _ref3.name,
111
+ payload = _ref3.payload,
112
+ options = _ref3.options;
113
+ throw new Error('Not implemented.');
114
+ }
115
+
116
+ /**
117
+ * Call Analyzer: Media Quality Event
118
+ * @param args
119
+ */
120
+ }, {
121
+ key: "submitMQE",
122
+ value: function submitMQE(_ref4) {
123
+ var name = _ref4.name,
124
+ payload = _ref4.payload,
125
+ options = _ref4.options;
126
+ this.callDiagnosticLatencies.saveTimestamp(name);
127
+ this.callDiagnosticMetrics.submitMQE({
128
+ name: name,
129
+ payload: payload,
130
+ options: options
131
+ });
132
+ }
133
+
134
+ /**
135
+ * Call Analyzer: Feature Usage Event
136
+ * @param args
137
+ */
138
+ }, {
139
+ key: "submitFeatureEvent",
140
+ value: function submitFeatureEvent(_ref5) {
141
+ var name = _ref5.name,
142
+ payload = _ref5.payload,
143
+ options = _ref5.options;
144
+ throw new Error('Not implemented.');
145
+ }
146
+
147
+ /**
148
+ * Call Analyzer: Client Event
149
+ * @public
150
+ * @param args
151
+ */
152
+ }, {
153
+ key: "submitClientEvent",
154
+ value: function submitClientEvent(_ref6) {
155
+ var name = _ref6.name,
156
+ payload = _ref6.payload,
157
+ options = _ref6.options;
158
+ this.callDiagnosticLatencies.saveTimestamp(name);
159
+ this.callDiagnosticMetrics.submitClientEvent({
160
+ name: name,
161
+ payload: payload,
162
+ options: options
163
+ });
164
+ }
165
+ }]);
166
+ return Metrics;
167
+ }(_webexCore.WebexPlugin);
168
+ (0, _defineProperty2.default)(Metrics, "instance", void 0);
169
+ var _default = Metrics;
170
+ exports.default = _default;
171
+ //# sourceMappingURL=new-metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Metrics","args","callDiagnosticLatencies","CallDiagnosticLatencies","onReady","webex","once","callDiagnosticMetrics","CallDiagnosticMetrics","parent","name","payload","options","clearTimestamps","saveTimestamp","Error","submitMQE","submitClientEvent","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';\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.callDiagnosticLatencies = new CallDiagnosticLatencies();\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 });\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(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(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(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 }) {\n this.callDiagnosticLatencies.saveTimestamp(name);\n this.callDiagnosticMetrics.submitClientEvent({name, payload, options});\n }\n}\n\nexport default Metrics;\n"],"mappings":";;;;;;;;;;;;;;;;AAKA;AAEA;AAWA;AAA0F;AAAA;AAE1F;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,uBAAuB,GAAG,IAAIC,uCAAuB,EAAE;IAE5D,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;MAClF,CAAC,CAAC;IACJ;;IAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,mCAQG;MAAA,IAPDK,IAAI,QAAJA,IAAI;QACJC,OAAO,QAAPA,OAAO;QACPC,OAAO,QAAPA,OAAO;MAMP,IAAIF,IAAI,KAAK,+BAA+B,EAAE;QAC5C,IAAI,CAACR,uBAAuB,CAACW,eAAe,EAAE;MAChD,CAAC,MAAM;QACL,IAAI,CAACX,uBAAuB,CAACY,aAAa,CAACJ,IAAI,CAAC;MAClD;IACF;;IAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,sCAQG;MAAA,IAPDA,IAAI,SAAJA,IAAI;QACJC,OAAO,SAAPA,OAAO;QACPC,OAAO,SAAPA,OAAO;MAMP,IAAI,CAACV,uBAAuB,CAACY,aAAa,CAACJ,IAAI,CAAC;MAChD,MAAM,IAAIK,KAAK,CAAC,kBAAkB,CAAC;IACrC;;IAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,uCAQG;MAAA,IAPDL,IAAI,SAAJA,IAAI;QACJC,OAAO,SAAPA,OAAO;QACPC,OAAO,SAAPA,OAAO;MAMP,MAAM,IAAIG,KAAK,CAAC,kBAAkB,CAAC;IACrC;;IAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,0BAUG;MAAA,IATDL,IAAI,SAAJA,IAAI;QACJC,OAAO,SAAPA,OAAO;QACPC,OAAO,SAAPA,OAAO;MAQP,IAAI,CAACV,uBAAuB,CAACY,aAAa,CAACJ,IAAI,CAAC;MAChD,IAAI,CAACH,qBAAqB,CAACS,SAAS,CAAC;QAACN,IAAI,EAAJA,IAAI;QAAEC,OAAO,EAAPA,OAAO;QAAEC,OAAO,EAAPA;MAAO,CAAC,CAAC;IAChE;;IAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,mCAQG;MAAA,IAPDF,IAAI,SAAJA,IAAI;QACJC,OAAO,SAAPA,OAAO;QACPC,OAAO,SAAPA,OAAO;MAMP,MAAM,IAAIG,KAAK,CAAC,kBAAkB,CAAC;IACrC;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAA;IAAA,OAKA,kCAQG;MAAA,IAPDL,IAAI,SAAJA,IAAI;QACJC,OAAO,SAAPA,OAAO;QACPC,OAAO,SAAPA,OAAO;MAMP,IAAI,CAACV,uBAAuB,CAACY,aAAa,CAACJ,IAAI,CAAC;MAChD,IAAI,CAACH,qBAAqB,CAACU,iBAAiB,CAAC;QAACP,IAAI,EAAJA,IAAI;QAAEC,OAAO,EAAPA,OAAO;QAAEC,OAAO,EAAPA;MAAO,CAAC,CAAC;IACxE;EAAC;EAAA;AAAA,EA3ImBM,sBAAW;AAAA,8BAA3BlB,OAAO;AAAA,eA8IEA,OAAO;AAAA"}
@@ -0,0 +1,2 @@
1
+ export default MetricsBatcher;
2
+ declare const MetricsBatcher: any;
@@ -0,0 +1,2 @@
1
+ declare const CallDiagnosticEventsBatcher: any;
2
+ export default CallDiagnosticEventsBatcher;
@@ -0,0 +1,154 @@
1
+ import { MetricEventNames } from '../metrics.types';
2
+ /**
3
+ * @description Helper class to store latencies timestamp and to calculate various latencies for CA.
4
+ * @exports
5
+ * @class CallDiagnosticLatencies
6
+ */
7
+ export default class CallDiagnosticLatencies {
8
+ latencyTimestamps: Map<MetricEventNames, number>;
9
+ /**
10
+ * @constructor
11
+ */
12
+ constructor();
13
+ /**
14
+ * Clear timestamps
15
+ */
16
+ clearTimestamps(): void;
17
+ /**
18
+ * Store timestamp value
19
+ * @param key - key
20
+ * @param value -value
21
+ * @throws
22
+ * @returns
23
+ */
24
+ saveTimestamp(key: MetricEventNames, value?: number): void;
25
+ /**
26
+ * Helper to calculate end - start
27
+ * @param a start
28
+ * @param b end
29
+ * @returns latency
30
+ */
31
+ getDiffBetweenTimestamps(a: MetricEventNames, b: MetricEventNames): number;
32
+ /**
33
+ * Meeting Info Request
34
+ * @note Meeting Info request happen not just in the join phase. CA requires
35
+ * metrics around meeting info request that are only part of join phase.
36
+ * This internal.* event is used to track the real timestamps
37
+ * (when the actual request/response happen). This is because the actual CA event is
38
+ * sent inside the join method on the meeting object based on some logic, but that's not exactly when
39
+ * those events are actually fired. The logic only confirms that they have happened, and we send them over.
40
+ * @returns - latency
41
+ */
42
+ getMeetingInfoReqResp(): number;
43
+ /**
44
+ * Interstitial Time
45
+ * @returns - latency
46
+ */
47
+ getShowInterstitialTime(): number;
48
+ /**
49
+ * Call Init Join Request
50
+ * @returns - latency
51
+ */
52
+ getCallInitJoinReq(): number;
53
+ /**
54
+ * Locus Join Request
55
+ * @returns - latency
56
+ */
57
+ getJoinReqResp(): number;
58
+ /**
59
+ * Locus Join Response Sent Received
60
+ * @returns - latency
61
+ */
62
+ getJoinRespSentReceived(): any;
63
+ /**
64
+ * Local SDP Generated Remote SDP REceived
65
+ * @returns - latency
66
+ */
67
+ getLocalSDPGenRemoteSDPRecv(): number;
68
+ /**
69
+ * ICE Setup Time
70
+ * @returns - latency
71
+ */
72
+ getICESetupTime(): number;
73
+ /**
74
+ * Audio ICE time
75
+ * @returns - latency
76
+ */
77
+ getAudioICESetupTime(): number;
78
+ /**
79
+ * Video ICE Time
80
+ * @returns - latency
81
+ */
82
+ getVideoICESetupTime(): number;
83
+ /**
84
+ * Share ICE Time
85
+ * @returns - latency
86
+ */
87
+ getShareICESetupTime(): number;
88
+ /**
89
+ * Stay Lobby Time
90
+ * @returns - latency
91
+ */
92
+ getStayLobbyTime(): number;
93
+ /**
94
+ * Page JMT
95
+ * @returns - latency
96
+ */
97
+ getPageJMT(): number;
98
+ /**
99
+ * Click To Interstitial
100
+ * @returns - latency
101
+ */
102
+ getClickToInterstitial(): number;
103
+ /**
104
+ * Interstitial To Join Ok
105
+ * @returns - latency
106
+ */
107
+ getInterstitialToJoinOK(): number;
108
+ /**
109
+ * Interstitial To Media Ok
110
+ * @returns - latency
111
+ */
112
+ getInterstitialToMediaOK(): number;
113
+ /**
114
+ * Total JMT
115
+ * @returns - latency
116
+ */
117
+ getTotalJMT(): number;
118
+ /**
119
+ * Join Conf JMT
120
+ * @returns - latency
121
+ */
122
+ getJoinConfJMT(): number;
123
+ /**
124
+ * Total Media JMT
125
+ * @returns - latency
126
+ */
127
+ getTotalMediaJMT(): number;
128
+ /**
129
+ * Client JMT
130
+ * @returns - latency
131
+ */
132
+ getClientJMT(): number;
133
+ /**
134
+ * Interstitial To Media OK JMT
135
+ * @returns - latency
136
+ */
137
+ getInterstitialToMediaOKJMT(): number;
138
+ /**
139
+ * Audio setup delay receive
140
+ */
141
+ getAudioJoinRespRxStart(): number;
142
+ /**
143
+ * Video setup delay receive
144
+ */
145
+ getVideoJoinRespRxStart(): number;
146
+ /**
147
+ * Audio setup delay transmit
148
+ */
149
+ getAudioJoinRespTxStart(): number;
150
+ /**
151
+ * Video setup delay transmit
152
+ */
153
+ getVideoJoinRespTxStart(): number;
154
+ }
@@ -0,0 +1,324 @@
1
+ import { StatelessWebexPlugin } from '@webex/webex-core';
2
+ import { Event, ClientType, SubClientType, NetworkType, ClientEvent, SubmitClientEventOptions, MediaQualityEvent, SubmitMQEOptions, SubmitMQEPayload, ClientEventError, ClientEventPayload } from '../metrics.types';
3
+ type GetOriginOptions = {
4
+ clientType: ClientType;
5
+ subClientType: SubClientType;
6
+ networkType?: NetworkType;
7
+ };
8
+ type GetIdentifiersOptions = {
9
+ meeting?: any;
10
+ mediaConnections?: any[];
11
+ correlationId?: string;
12
+ };
13
+ /**
14
+ * @description Util class to handle Call Analyzer Metrics
15
+ * @export
16
+ * @class CallDiagnosticMetrics
17
+ */
18
+ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
19
+ private callDiagnosticEventsBatcher;
20
+ /**
21
+ * Constructor
22
+ * @param args
23
+ */
24
+ constructor(...args: any[]);
25
+ /**
26
+ * Returns the login type of the current user
27
+ * @returns one of 'login-ci','unverified-guest', null
28
+ */
29
+ getCurLoginType(): "login-ci" | "unverified-guest";
30
+ /**
31
+ * Get origin object for Call Diagnostic Event payload.
32
+ * @param options
33
+ * @param meetingId
34
+ * @returns
35
+ */
36
+ getOrigin(options: GetOriginOptions, meetingId?: string): {
37
+ name: "antares" | "beech" | "breakout" | "cb" | "cloudproxy" | "edonus" | "endpoint" | "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";
38
+ userAgent: string;
39
+ buildType?: "debug" | "test" | "prod" | "tap" | "analyzer-test";
40
+ upgradeChannel?: string;
41
+ instanceId?: string;
42
+ networkType: "unknown" | "wifi" | "ethernet" | "cellular";
43
+ localIP?: string;
44
+ usingProxy?: boolean;
45
+ mediaEngineSoftwareVersion?: string;
46
+ environment?: string;
47
+ newEnvironment?: string;
48
+ clientInfo?: {
49
+ os: "windows" | "mac" | "ios" | "android" | "chrome" | "linux" | "other" | "uwp-arm64";
50
+ osVersion: string;
51
+ localIP?: string;
52
+ gatewayIP?: string;
53
+ macAddress?: string;
54
+ localNetworkPrefix?: string;
55
+ publicNetworkPrefix?: string;
56
+ browserLaunchMethod?: "activex" | "npapi" | "extension" | "cwsapi" | "java" | "tfs" | "webacd" | "url-handler" | "thinclient";
57
+ clientLaunchMethod?: "url-handler" | "universal-link" | "voice-command" | "notification" | "manual" | "teams-cross-launch";
58
+ browser?: string;
59
+ browserVersion?: string;
60
+ clientType?: "SIP" | "MEETING_CENTER" | "EVENT_CENTER" | "TRAINING_CENTER" | "TEAMS_CLIENT" | "TEAMS_DEVICE" | "TEAMS_SHARE" | "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";
61
+ subClientType?: "DESKTOP_APP" | "DESKTOP_APP_VDI" | "DEVICE_CURRENT" | "DEVICE_LEGACY_2020" | "HVDI_APP" | "MOBILE_APP" | "VDI_APP" | "WEB_APP" | "MOBILE_NETWORK" | "HOLOGRAM_HEADSET_APP";
62
+ clientVersion?: string;
63
+ localClientVersion?: string;
64
+ modelNumber?: string;
65
+ joinFirstUpdateLater?: "ep-enabled" | "sp-enabled" | "not-enabled";
66
+ standbyUsed?: boolean;
67
+ prefetchDocShowUsed?: boolean;
68
+ fastJoinUsed?: boolean;
69
+ clientDownloadSize?: number;
70
+ clientDownloadFileCount?: number;
71
+ nodeId?: number;
72
+ machineInfo?: string;
73
+ parentAppName?: string;
74
+ parentAppInPermitList?: boolean;
75
+ meetingSiteType?: "train" | "webex-11" | "orion";
76
+ CDNEnabled?: boolean;
77
+ clientMajorVersion?: string;
78
+ majorVersion?: number;
79
+ minorVersion?: number;
80
+ revision?: number;
81
+ isValidClientVersion?: boolean;
82
+ cpuInfo?: {
83
+ description: string;
84
+ clockSpeedGigaHertz: number;
85
+ numberOfCores: number;
86
+ architecture: "unknown" | "intel32" | "intel64" | "amd32" | "amd64" | "arm32" | "arm64";
87
+ staticPerformance?: string;
88
+ };
89
+ 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";
90
+ videoDisplayMode?: "grid-view" | "active-speaker-view";
91
+ videoLayoutType?: "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare";
92
+ videoRenderType?: "wme" | "client_d3d" | "client_gdi";
93
+ vdiInfo?: unknown;
94
+ is64BitsClient?: boolean;
95
+ webexAppVersion?: string;
96
+ launch32BitsReason?: "forcewin32" | "disablewin64" | "platform_win32" | "platform_arm" | "platform_unknown" | "version_below_41.11";
97
+ inMeetingUpdate?: boolean;
98
+ mtaVersion?: string;
99
+ isWarholOpening?: boolean;
100
+ };
101
+ isHybridMedia?: boolean;
102
+ originData?: {};
103
+ };
104
+ /**
105
+ * Gather identifier details for call diagnostic payload.
106
+ * @throws Error if initialization fails.
107
+ * @param options
108
+ */
109
+ getIdentifiers(options: GetIdentifiersOptions): {
110
+ attendeeId?: string;
111
+ breakoutGroupId?: string;
112
+ breakoutMoveId?: string;
113
+ breakoutSessionId?: string;
114
+ confluenceId?: string;
115
+ cpaasIdentifiers?: {
116
+ imiTenantId: string;
117
+ devClientId: string;
118
+ imiServiceId: string;
119
+ imiAppId: string;
120
+ sessionId: string;
121
+ sessionInstanceId: string;
122
+ };
123
+ csdmDeviceUrl?: string;
124
+ destinationBreakoutSessionId?: string;
125
+ destinationLocusSessionId?: string;
126
+ destinationLocusUrl?: string;
127
+ destinationVenueId?: string;
128
+ deviceId?: string;
129
+ ivrCallId?: string;
130
+ ivrDialogId?: string;
131
+ ivrId?: string;
132
+ locusId?: string;
133
+ locusSessionId?: string;
134
+ locusStartTime?: string;
135
+ locusUrl?: string;
136
+ mediaAgentAlias?: string;
137
+ mediaAgentGroupId?: string;
138
+ meetClusterName?: string;
139
+ meetingLookupUrl?: string;
140
+ meetingOrgId?: string;
141
+ msteamsTenantGuid?: string;
142
+ msteamsConferenceId?: string;
143
+ oauth2ClientId?: string;
144
+ orgId?: string;
145
+ roomId?: string;
146
+ sipCallId?: string;
147
+ sipSessionId?: {
148
+ local?: string;
149
+ remote?: string;
150
+ };
151
+ sipUri?: string;
152
+ subConfId?: string;
153
+ tenantId?: string;
154
+ trackingId?: string;
155
+ userId?: string;
156
+ venueId?: string;
157
+ venueUrl?: string;
158
+ whiteboardUrl?: string;
159
+ webexConferenceId?: number;
160
+ webexClusterName?: string;
161
+ webexConferenceIdStr?: string;
162
+ webexDataCenter?: string;
163
+ webexGuestId?: number;
164
+ webexMeetingId?: number;
165
+ webexNodeId?: number;
166
+ webexSiteId?: number;
167
+ webexSiteName?: string;
168
+ webexUserId?: number;
169
+ webexWebDomain?: string;
170
+ correlationId: string;
171
+ } | {
172
+ attendeeId?: string;
173
+ breakoutGroupId?: string;
174
+ breakoutMoveId?: string;
175
+ breakoutSessionId?: string;
176
+ confluenceId?: string;
177
+ cpaasIdentifiers?: {
178
+ imiTenantId: string;
179
+ devClientId: string;
180
+ imiServiceId: string;
181
+ imiAppId: string;
182
+ sessionId: string;
183
+ sessionInstanceId: string;
184
+ };
185
+ csdmDeviceUrl?: string;
186
+ destinationBreakoutSessionId?: string;
187
+ destinationLocusSessionId?: string;
188
+ destinationLocusUrl?: string;
189
+ destinationVenueId?: string;
190
+ deviceId?: string;
191
+ ivrCallId?: string;
192
+ ivrDialogId?: string;
193
+ ivrId?: string;
194
+ locusId?: string;
195
+ locusSessionId?: string;
196
+ locusStartTime?: string;
197
+ locusUrl?: string;
198
+ mediaAgentAlias?: string;
199
+ mediaAgentGroupId?: string;
200
+ meetClusterName?: string;
201
+ meetingLookupUrl?: string;
202
+ meetingOrgId?: string;
203
+ msteamsTenantGuid?: string;
204
+ msteamsConferenceId?: string;
205
+ oauth2ClientId?: string;
206
+ orgId?: string;
207
+ provisionalCorrelationId?: string;
208
+ roomId?: string;
209
+ sipCallId?: string;
210
+ sipSessionId?: {
211
+ local?: string;
212
+ remote?: string;
213
+ };
214
+ sipUri?: string;
215
+ subConfId?: string;
216
+ tenantId?: string;
217
+ trackingId?: string;
218
+ userId?: string;
219
+ venueId?: string;
220
+ venueUrl?: string;
221
+ whiteboardUrl?: string;
222
+ webexConferenceId?: number;
223
+ webexClusterName?: string;
224
+ webexConferenceIdStr?: string;
225
+ webexDataCenter?: string;
226
+ webexGuestId?: number;
227
+ webexMeetingId?: number;
228
+ webexNodeId?: number;
229
+ webexSiteId?: number;
230
+ webexSiteName?: string;
231
+ webexUserId?: number;
232
+ webexWebDomain?: string;
233
+ correlationId: string;
234
+ };
235
+ /**
236
+ * Create diagnostic event, which can hold client event, feature event or MQE event data.
237
+ * This just initiates the shared properties that are required for all the 3 event categories.
238
+ * @param eventData
239
+ * @param options
240
+ * @returns
241
+ */
242
+ prepareDiagnosticEvent(eventData: Event['event'], options: any): Event;
243
+ /**
244
+ * TODO: NOT IMPLEMENTED
245
+ * Submit Feature Event
246
+ * @returns
247
+ */
248
+ submitFeatureEvent(): void;
249
+ /**
250
+ * Submit Media Quality Event
251
+ * @param args - submit params
252
+ * @param arg.name - event key
253
+ * @param arg.payload - additional payload to be merge with the default payload
254
+ * @param arg.options - options
255
+ */
256
+ submitMQE({ name, payload, options, }: {
257
+ name: MediaQualityEvent['name'];
258
+ payload: SubmitMQEPayload;
259
+ options: SubmitMQEOptions;
260
+ }): void;
261
+ /**
262
+ * Return Client Event payload by client error code
263
+ * @param arg - get error arg
264
+ * @param arg.clientErrorCode
265
+ * @param arg.serviceErrorCode
266
+ * @returns
267
+ */
268
+ getErrorPayloadForClientErrorCode({ clientErrorCode, serviceErrorCode, }: {
269
+ clientErrorCode: number;
270
+ serviceErrorCode: any;
271
+ }): ClientEventError;
272
+ /**
273
+ * Generate error payload for Client Event
274
+ * @param rawError
275
+ */
276
+ generateClientEventErrorPayload(rawError: any): {
277
+ fatal: boolean;
278
+ category: "other" | "signaling" | "media" | "expected";
279
+ errorDescription?: string;
280
+ errorCode?: number;
281
+ errorCodeStr?: string;
282
+ httpCode?: number;
283
+ errorData?: {};
284
+ shownToUser: boolean;
285
+ serviceErrorCode?: number;
286
+ name: "other" | "media-engine" | "ice.failed" | "locus.response" | "locus.leave" | "client.leave" | "media-device" | "media-sca";
287
+ };
288
+ /**
289
+ * Create client event object for in meeting events
290
+ * @param arg - create args
291
+ * @param arg.event - event key
292
+ * @param arg.options - options
293
+ * @returns object
294
+ */
295
+ private createClientEventObjectInMeeting;
296
+ /**
297
+ * Create client event object for pre meeting events
298
+ * @param arg - create args
299
+ * @param arg.event - event key
300
+ * @param arg.options - payload
301
+ * @returns object
302
+ */
303
+ private createClientEventObjectPreMeeting;
304
+ /**
305
+ * Submit Client Event CA event.
306
+ * @param arg - submit params
307
+ * @param arg.event - event key
308
+ * @param arg.payload - additional payload to be merged with default payload
309
+ * @param arg.options - payload
310
+ * @throws
311
+ */
312
+ submitClientEvent({ name, payload, options, }: {
313
+ name: ClientEvent['name'];
314
+ payload?: ClientEventPayload;
315
+ options: SubmitClientEventOptions;
316
+ }): void;
317
+ /**
318
+ * Prepare the event and send the request to metrics-a service.
319
+ * @param event
320
+ * @returns promise
321
+ */
322
+ submitToCallDiagnostics(event: Event): Promise<void>;
323
+ }
324
+ export {};