@webex/internal-plugin-metrics 3.0.0-beta.20 → 3.0.0-beta.200

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 +56 -0
  2. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
  3. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +451 -0
  4. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
  5. package/dist/call-diagnostic/call-diagnostic-metrics.js +584 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  7. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +225 -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 +249 -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 +189 -0
  30. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +348 -0
  31. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +52 -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 +92 -0
  41. package/dist/types/new-metrics.d.ts +119 -0
  42. package/package.json +12 -8
  43. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +51 -0
  44. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +408 -0
  45. package/src/call-diagnostic/call-diagnostic-metrics.ts +591 -0
  46. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +233 -0
  47. package/src/call-diagnostic/config.ts +455 -0
  48. package/src/call-diagnostic/generated-types-temp/ClientEvent.ts +2395 -0
  49. package/src/call-diagnostic/generated-types-temp/Event.ts +7762 -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 +137 -0
  55. package/src/new-metrics.ts +223 -0
  56. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +243 -0
  57. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +474 -0
  58. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +820 -0
  59. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +336 -0
  60. package/test/unit/spec/metrics.js +65 -97
  61. package/test/unit/spec/new-metrics.ts +153 -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,249 @@
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 _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
11
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
13
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
14
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
15
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
17
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
18
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
19
+ var _webexCore = require("@webex/webex-core");
20
+ var _callDiagnosticMetrics = _interopRequireDefault(require("./call-diagnostic/call-diagnostic-metrics"));
21
+ var _callDiagnosticMetricsLatencies = _interopRequireDefault(require("./call-diagnostic/call-diagnostic-metrics-latencies"));
22
+ var _callDiagnosticMetrics2 = require("./call-diagnostic/call-diagnostic-metrics.util");
23
+ 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); }; }
24
+ 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; } }
25
+ /**
26
+ * Metrics plugin to centralize all types of metrics.
27
+ * @class
28
+ */
29
+ var Metrics = /*#__PURE__*/function (_WebexPlugin) {
30
+ (0, _inherits2.default)(Metrics, _WebexPlugin);
31
+ var _super = _createSuper(Metrics);
32
+ // eslint-disable-next-line no-use-before-define
33
+
34
+ // Call Diagnostic latencies
35
+
36
+ // Helper classes to handle the different types of metrics
37
+
38
+ /**
39
+ * Constructor
40
+ * @param args
41
+ * @constructor
42
+ * @private
43
+ * @returns
44
+ */
45
+ function Metrics() {
46
+ var _this;
47
+ (0, _classCallCheck2.default)(this, Metrics);
48
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49
+ args[_key] = arguments[_key];
50
+ }
51
+ _this = _super.call.apply(_super, [this].concat(args));
52
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callDiagnosticLatencies", void 0);
53
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callDiagnosticMetrics", void 0);
54
+ _this.onReady();
55
+ return _this;
56
+ }
57
+
58
+ /**
59
+ * On Ready
60
+ */
61
+ (0, _createClass2.default)(Metrics, [{
62
+ key: "onReady",
63
+ value: function onReady() {
64
+ var _this2 = this;
65
+ // @ts-ignore
66
+ this.webex.once('ready', function () {
67
+ // @ts-ignore
68
+ _this2.callDiagnosticMetrics = new _callDiagnosticMetrics.default({}, {
69
+ parent: _this2.webex
70
+ });
71
+ // @ts-ignore
72
+ _this2.callDiagnosticLatencies = new _callDiagnosticMetricsLatencies.default({}, {
73
+ parent: _this2.webex
74
+ });
75
+ });
76
+ }
77
+
78
+ /**
79
+ * Used for internal purposes only
80
+ * @param args
81
+ */
82
+ }, {
83
+ key: "submitInternalEvent",
84
+ value: function submitInternalEvent(_ref) {
85
+ var name = _ref.name,
86
+ payload = _ref.payload,
87
+ options = _ref.options;
88
+ if (name === 'internal.reset.join.latencies') {
89
+ this.callDiagnosticLatencies.clearTimestamps();
90
+ } else {
91
+ this.callDiagnosticLatencies.saveTimestamp({
92
+ key: name
93
+ });
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Behavioral event
99
+ * @param args
100
+ */
101
+ }, {
102
+ key: "submitBehavioralEvent",
103
+ value: function submitBehavioralEvent(_ref2) {
104
+ var name = _ref2.name,
105
+ payload = _ref2.payload,
106
+ options = _ref2.options;
107
+ this.callDiagnosticLatencies.saveTimestamp({
108
+ key: name
109
+ });
110
+ throw new Error('Not implemented.');
111
+ }
112
+
113
+ /**
114
+ * Operational event
115
+ * @param args
116
+ */
117
+ }, {
118
+ key: "submitOperationalEvent",
119
+ value: function submitOperationalEvent(_ref3) {
120
+ var name = _ref3.name,
121
+ payload = _ref3.payload,
122
+ options = _ref3.options;
123
+ throw new Error('Not implemented.');
124
+ }
125
+
126
+ /**
127
+ * Call Analyzer: Media Quality Event
128
+ * @param args
129
+ */
130
+ }, {
131
+ key: "submitMQE",
132
+ value: function submitMQE(_ref4) {
133
+ var name = _ref4.name,
134
+ payload = _ref4.payload,
135
+ options = _ref4.options;
136
+ this.callDiagnosticLatencies.saveTimestamp({
137
+ key: name
138
+ });
139
+ this.callDiagnosticMetrics.submitMQE({
140
+ name: name,
141
+ payload: payload,
142
+ options: options
143
+ });
144
+ }
145
+
146
+ /**
147
+ * Call Analyzer: Feature Usage Event
148
+ * @param args
149
+ */
150
+ }, {
151
+ key: "submitFeatureEvent",
152
+ value: function submitFeatureEvent(_ref5) {
153
+ var name = _ref5.name,
154
+ payload = _ref5.payload,
155
+ options = _ref5.options;
156
+ throw new Error('Not implemented.');
157
+ }
158
+
159
+ /**
160
+ * Call Analyzer: Client Event
161
+ * @public
162
+ * @param args
163
+ */
164
+ }, {
165
+ key: "submitClientEvent",
166
+ value: function submitClientEvent(_ref6) {
167
+ var name = _ref6.name,
168
+ payload = _ref6.payload,
169
+ options = _ref6.options;
170
+ this.callDiagnosticLatencies.saveTimestamp({
171
+ key: name,
172
+ options: {
173
+ meetingId: options === null || options === void 0 ? void 0 : options.meetingId
174
+ }
175
+ });
176
+ return this.callDiagnosticMetrics.submitClientEvent({
177
+ name: name,
178
+ payload: payload,
179
+ options: options
180
+ });
181
+ }
182
+
183
+ /**
184
+ * Returns a promise that will resolve to fetch options for submitting a metric.
185
+ *
186
+ * This is to support quickly submitting metrics when the browser/tab is closing.
187
+ * Calling submitClientEvent will not work because there some async steps that will
188
+ * not complete before the browser is closed. Instead, we pre-gather all the
189
+ * information/options needed for the request(s), and then simply and quickly
190
+ * fire the fetch(es) when beforeUnload is triggered.
191
+ *
192
+ * We must use fetch instead of request because fetch has a keepalive option that
193
+ * allows the request it to outlive the page.
194
+ *
195
+ * Note: the timings values will be wrong, but setMetricTimingsAndFetch() will
196
+ * properly adjust them before submitting.
197
+ *
198
+ * @public
199
+ * @param {Object} arg
200
+ * @param {String} arg.name - event name
201
+ * @param {Object} arg.payload - event payload
202
+ * @param {Object} arg.options - other options
203
+ * @returns {Promise} promise that resolves to options to be used with fetch
204
+ */
205
+ }, {
206
+ key: "buildClientEventFetchRequestOptions",
207
+ value: function () {
208
+ var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref7) {
209
+ var name, payload, options;
210
+ return _regenerator.default.wrap(function _callee$(_context) {
211
+ while (1) switch (_context.prev = _context.next) {
212
+ case 0:
213
+ name = _ref7.name, payload = _ref7.payload, options = _ref7.options;
214
+ return _context.abrupt("return", this.callDiagnosticMetrics.buildClientEventFetchRequestOptions({
215
+ name: name,
216
+ payload: payload,
217
+ options: options
218
+ }));
219
+ case 2:
220
+ case "end":
221
+ return _context.stop();
222
+ }
223
+ }, _callee, this);
224
+ }));
225
+ function buildClientEventFetchRequestOptions(_x) {
226
+ return _buildClientEventFetchRequestOptions.apply(this, arguments);
227
+ }
228
+ return buildClientEventFetchRequestOptions;
229
+ }()
230
+ /**
231
+ * Submits a metric from pre-built request options via the fetch API. Updates
232
+ * the "$timings" and "originTime" values to Date.now() since the existing times
233
+ * were set when the options were built (not submitted).
234
+ * @param {any} options - the pre-built request options for submitting a metric
235
+ * @returns {Promise} promise that resolves to the response object
236
+ */
237
+ }, {
238
+ key: "setMetricTimingsAndFetch",
239
+ value: function setMetricTimingsAndFetch(options) {
240
+ // @ts-ignore
241
+ return this.webex.setTimingsAndFetch((0, _callDiagnosticMetrics2.setMetricTimings)(options));
242
+ }
243
+ }]);
244
+ return Metrics;
245
+ }(_webexCore.WebexPlugin);
246
+ (0, _defineProperty2.default)(Metrics, "instance", void 0);
247
+ var _default = Metrics;
248
+ exports.default = _default;
249
+ //# sourceMappingURL=new-metrics.js.map
@@ -0,0 +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":"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"}
@@ -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,189 @@
1
+ import { WebexPlugin } from '@webex/webex-core';
2
+ import { MetricEventNames } from '../metrics.types';
3
+ /**
4
+ * @description Helper class to store latencies timestamp and to calculate various latencies for CA.
5
+ * @exports
6
+ * @class CallDiagnosticLatencies
7
+ */
8
+ export default class CallDiagnosticLatencies extends WebexPlugin {
9
+ latencyTimestamps: Map<MetricEventNames, number>;
10
+ precomputedLatencies: Map<string, number>;
11
+ private meetingId?;
12
+ /**
13
+ * @constructor
14
+ */
15
+ constructor(...args: any[]);
16
+ /**
17
+ * Clear timestamps
18
+ */
19
+ clearTimestamps(): void;
20
+ /**
21
+ * Associate current latencies with a meeting id
22
+ * @param meetingId
23
+ */
24
+ private setMeetingId;
25
+ /**
26
+ * Returns the meeting object associated with current latencies
27
+ * @returns meeting object
28
+ */
29
+ private getMeeting;
30
+ /**
31
+ * Store timestamp value
32
+ * @param key - key
33
+ * @param value -value
34
+ * @throws
35
+ * @returns
36
+ */
37
+ saveTimestamp({ key, value, options, }: {
38
+ key: MetricEventNames;
39
+ value?: number;
40
+ options?: {
41
+ meetingId?: string;
42
+ };
43
+ }): void;
44
+ /**
45
+ * Store precomputed latency value
46
+ * @param key - key
47
+ * @param value -value
48
+ * @throws
49
+ * @returns
50
+ */
51
+ saveLatency(key: string, value: number): void;
52
+ /**
53
+ * Store only the first timestamp value for the given key
54
+ * @param key - key
55
+ * @param value -value
56
+ * @throws
57
+ * @returns
58
+ */
59
+ saveFirstTimestampOnly(key: MetricEventNames, value?: number): void;
60
+ /**
61
+ * Helper to calculate end - start
62
+ * @param a start
63
+ * @param b end
64
+ * @returns latency
65
+ */
66
+ getDiffBetweenTimestamps(a: MetricEventNames, b: MetricEventNames): number;
67
+ /**
68
+ * Meeting Info Request
69
+ * @note Meeting Info request happen not just in the join phase. CA requires
70
+ * metrics around meeting info request that are only part of join phase.
71
+ * This internal.* event is used to track the real timestamps
72
+ * (when the actual request/response happen). This is because the actual CA event is
73
+ * sent inside the join method on the meeting object based on some logic, but that's not exactly when
74
+ * those events are actually fired. The logic only confirms that they have happened, and we send them over.
75
+ * @returns - latency
76
+ */
77
+ getMeetingInfoReqResp(): number;
78
+ /**
79
+ * Interstitial Time
80
+ * @returns - latency
81
+ */
82
+ getShowInterstitialTime(): number;
83
+ /**
84
+ * Call Init Join Request
85
+ * @returns - latency
86
+ */
87
+ getCallInitJoinReq(): number;
88
+ /**
89
+ * Locus Join Request
90
+ * @returns - latency
91
+ */
92
+ getJoinReqResp(): number;
93
+ /**
94
+ * Locus Join Response Sent Received
95
+ * @returns - latency
96
+ */
97
+ getJoinRespSentReceived(): any;
98
+ /**
99
+ * Local SDP Generated Remote SDP REceived
100
+ * @returns - latency
101
+ */
102
+ getLocalSDPGenRemoteSDPRecv(): number;
103
+ /**
104
+ * ICE Setup Time
105
+ * @returns - latency
106
+ */
107
+ getICESetupTime(): number;
108
+ /**
109
+ * Audio ICE time
110
+ * @returns - latency
111
+ */
112
+ getAudioICESetupTime(): number;
113
+ /**
114
+ * Video ICE Time
115
+ * @returns - latency
116
+ */
117
+ getVideoICESetupTime(): number;
118
+ /**
119
+ * Share ICE Time
120
+ * @returns - latency
121
+ */
122
+ getShareICESetupTime(): number;
123
+ /**
124
+ * Stay Lobby Time
125
+ * @returns - latency
126
+ */
127
+ getStayLobbyTime(): number;
128
+ /**
129
+ * Page JMT
130
+ * @returns - latency
131
+ */
132
+ getPageJMT(): number;
133
+ /**
134
+ * Click To Interstitial
135
+ * @returns - latency
136
+ */
137
+ getClickToInterstitial(): number;
138
+ /**
139
+ * Interstitial To Join Ok
140
+ * @returns - latency
141
+ */
142
+ getInterstitialToJoinOK(): number;
143
+ /**
144
+ * Call Init To MediaEngineReady
145
+ * @returns - latency
146
+ */
147
+ getCallInitMediaEngineReady(): number;
148
+ /**
149
+ * Interstitial To Media Ok
150
+ * @returns - latency
151
+ */
152
+ getInterstitialToMediaOKJMT(): number;
153
+ /**
154
+ * Total JMT
155
+ * @returns - latency
156
+ */
157
+ getTotalJMT(): number;
158
+ /**
159
+ * Join Conf JMT
160
+ * @returns - latency
161
+ */
162
+ getJoinConfJMT(): number;
163
+ /**
164
+ * Total Media JMT
165
+ * @returns - latency
166
+ */
167
+ getTotalMediaJMT(): number;
168
+ /**
169
+ * Client JMT
170
+ * @returns - latency
171
+ */
172
+ getClientJMT(): number;
173
+ /**
174
+ * Audio setup delay receive
175
+ */
176
+ getAudioJoinRespRxStart(): number;
177
+ /**
178
+ * Video setup delay receive
179
+ */
180
+ getVideoJoinRespRxStart(): number;
181
+ /**
182
+ * Audio setup delay transmit
183
+ */
184
+ getAudioJoinRespTxStart(): number;
185
+ /**
186
+ * Video setup delay transmit
187
+ */
188
+ getVideoJoinRespTxStart(): number;
189
+ }