@webex/internal-plugin-metrics 3.0.0-beta.4 → 3.0.0-beta.400

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 (74) hide show
  1. package/README.md +1 -3
  2. package/dist/batcher.js +42 -22
  3. package/dist/batcher.js.map +1 -1
  4. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +65 -0
  5. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +508 -0
  7. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
  8. package/dist/call-diagnostic/call-diagnostic-metrics.js +860 -0
  9. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  10. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +367 -0
  11. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
  12. package/dist/call-diagnostic/config.js +627 -0
  13. package/dist/call-diagnostic/config.js.map +1 -0
  14. package/dist/client-metrics-batcher.js +3 -8
  15. package/dist/client-metrics-batcher.js.map +1 -1
  16. package/dist/config.js +23 -6
  17. package/dist/config.js.map +1 -1
  18. package/dist/index.js +46 -10
  19. package/dist/index.js.map +1 -1
  20. package/dist/metrics.js +47 -80
  21. package/dist/metrics.js.map +1 -1
  22. package/dist/metrics.types.js +7 -0
  23. package/dist/metrics.types.js.map +1 -0
  24. package/dist/new-metrics.js +300 -0
  25. package/dist/new-metrics.js.map +1 -0
  26. package/dist/prelogin-metrics-batcher.js +82 -0
  27. package/dist/prelogin-metrics-batcher.js.map +1 -0
  28. package/dist/types/batcher.d.ts +7 -0
  29. package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
  30. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +218 -0
  31. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +421 -0
  32. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +103 -0
  33. package/dist/types/call-diagnostic/config.d.ts +178 -0
  34. package/dist/types/client-metrics-batcher.d.ts +2 -0
  35. package/dist/types/config.d.ts +36 -0
  36. package/dist/types/index.d.ts +15 -0
  37. package/dist/types/metrics.d.ts +3 -0
  38. package/dist/types/metrics.types.d.ts +105 -0
  39. package/dist/types/new-metrics.d.ts +131 -0
  40. package/dist/types/prelogin-metrics-batcher.d.ts +2 -0
  41. package/dist/types/utils.d.ts +6 -0
  42. package/dist/utils.js +27 -0
  43. package/dist/utils.js.map +1 -0
  44. package/package.json +16 -8
  45. package/src/batcher.js +71 -26
  46. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +72 -0
  47. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +467 -0
  48. package/src/call-diagnostic/call-diagnostic-metrics.ts +919 -0
  49. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +395 -0
  50. package/src/call-diagnostic/config.ts +685 -0
  51. package/src/client-metrics-batcher.js +4 -4
  52. package/src/config.js +26 -5
  53. package/src/index.ts +56 -0
  54. package/src/metrics.js +47 -58
  55. package/src/metrics.types.ts +170 -0
  56. package/src/new-metrics.ts +278 -0
  57. package/src/prelogin-metrics-batcher.ts +95 -0
  58. package/src/utils.ts +17 -0
  59. package/test/unit/spec/batcher.js +28 -15
  60. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +457 -0
  61. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +657 -0
  62. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +2303 -0
  63. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +634 -0
  64. package/test/unit/spec/client-metrics-batcher.js +28 -15
  65. package/test/unit/spec/metrics.js +94 -116
  66. package/test/unit/spec/new-metrics.ts +231 -0
  67. package/test/unit/spec/prelogin-metrics-batcher.ts +250 -0
  68. package/test/unit/spec/utils.ts +22 -0
  69. package/tsconfig.json +6 -0
  70. package/dist/call-diagnostic-events-batcher.js +0 -70
  71. package/dist/call-diagnostic-events-batcher.js.map +0 -1
  72. package/src/call-diagnostic-events-batcher.js +0 -62
  73. package/src/index.js +0 -17
  74. package/test/unit/spec/call-diagnostic-events-batcher.js +0 -180
@@ -0,0 +1,508 @@
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 _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
11
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
13
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
15
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
16
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
17
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
18
+ var _webexCore = require("@webex/webex-core");
19
+ 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); }; }
20
+ 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; } }
21
+ // we only care about client event and feature event for now
22
+ /**
23
+ * @description Helper class to store latencies timestamp and to calculate various latencies for CA.
24
+ * @exports
25
+ * @class CallDiagnosticLatencies
26
+ */
27
+ var CallDiagnosticLatencies = /*#__PURE__*/function (_WebexPlugin) {
28
+ (0, _inherits2.default)(CallDiagnosticLatencies, _WebexPlugin);
29
+ var _super = _createSuper(CallDiagnosticLatencies);
30
+ // meetingId that the current latencies are for
31
+
32
+ /**
33
+ * @constructor
34
+ */
35
+ function CallDiagnosticLatencies() {
36
+ var _this;
37
+ (0, _classCallCheck2.default)(this, CallDiagnosticLatencies);
38
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
39
+ args[_key] = arguments[_key];
40
+ }
41
+ _this = _super.call.apply(_super, [this].concat(args));
42
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "latencyTimestamps", void 0);
43
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "precomputedLatencies", void 0);
44
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingId", void 0);
45
+ _this.latencyTimestamps = new _map.default();
46
+ _this.precomputedLatencies = new _map.default();
47
+ return _this;
48
+ }
49
+
50
+ /**
51
+ * Clear timestamps
52
+ */
53
+ (0, _createClass2.default)(CallDiagnosticLatencies, [{
54
+ key: "clearTimestamps",
55
+ value: function clearTimestamps() {
56
+ this.latencyTimestamps.clear();
57
+ }
58
+
59
+ /**
60
+ * Associate current latencies with a meeting id
61
+ * @param meetingId
62
+ */
63
+ }, {
64
+ key: "setMeetingId",
65
+ value: function setMeetingId(meetingId) {
66
+ this.meetingId = meetingId;
67
+ }
68
+
69
+ /**
70
+ * Returns the meeting object associated with current latencies
71
+ * @returns meeting object
72
+ */
73
+ }, {
74
+ key: "getMeeting",
75
+ value: function getMeeting() {
76
+ if (this.meetingId) {
77
+ // @ts-ignore
78
+ return this.webex.meetings.meetingCollection.get(this.meetingId);
79
+ }
80
+ return undefined;
81
+ }
82
+
83
+ /**
84
+ * Store timestamp value
85
+ * @param key - key
86
+ * @param value -value
87
+ * @throws
88
+ * @returns
89
+ */
90
+ }, {
91
+ key: "saveTimestamp",
92
+ value: function saveTimestamp(_ref) {
93
+ var key = _ref.key,
94
+ _ref$value = _ref.value,
95
+ value = _ref$value === void 0 ? new Date().getTime() : _ref$value,
96
+ _ref$options = _ref.options,
97
+ options = _ref$options === void 0 ? {} : _ref$options;
98
+ // save the meetingId so we can use the meeting object in latency calculations if needed
99
+ var meetingId = options.meetingId;
100
+ if (meetingId) {
101
+ this.setMeetingId(meetingId);
102
+ }
103
+ // for some events we're only interested in the first timestamp not last
104
+ // as these events can happen multiple times
105
+ if (key === 'client.media.rx.start' || key === 'client.media.tx.start' || key === 'internal.client.meetinginfo.request' || key === 'internal.client.meetinginfo.response') {
106
+ this.saveFirstTimestampOnly(key, value);
107
+ } else {
108
+ this.latencyTimestamps.set(key, value);
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Store precomputed latency value
114
+ * @param key - key
115
+ * @param value - value
116
+ * @param overwrite - overwrite existing value or add it
117
+ * @throws
118
+ * @returns
119
+ */
120
+ }, {
121
+ key: "saveLatency",
122
+ value: function saveLatency(key, value) {
123
+ var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
124
+ var existingValue = overwrite ? 0 : this.precomputedLatencies.get(key) || 0;
125
+ this.precomputedLatencies.set(key, value + existingValue);
126
+ }
127
+
128
+ /**
129
+ * Measure latency for a request
130
+ * @param key - key
131
+ * @param callback - callback for which you would like to measure latency
132
+ * @param overwrite - overwite existing value or add to it
133
+ * @returns
134
+ */
135
+ }, {
136
+ key: "measureLatency",
137
+ value: function measureLatency(callback, key) {
138
+ var _this2 = this;
139
+ var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
140
+ var start = performance.now();
141
+ return callback().finally(function () {
142
+ _this2.saveLatency(key, performance.now() - start, overwrite);
143
+ });
144
+ }
145
+
146
+ /**
147
+ * Store only the first timestamp value for the given key
148
+ * @param key - key
149
+ * @param value -value
150
+ * @throws
151
+ * @returns
152
+ */
153
+ }, {
154
+ key: "saveFirstTimestampOnly",
155
+ value: function saveFirstTimestampOnly(key) {
156
+ var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date().getTime();
157
+ if (this.latencyTimestamps.has(key)) {
158
+ return;
159
+ }
160
+ this.latencyTimestamps.set(key, value);
161
+ }
162
+
163
+ /**
164
+ * Helper to calculate end - start
165
+ * @param a start
166
+ * @param b end
167
+ * @returns latency
168
+ */
169
+ }, {
170
+ key: "getDiffBetweenTimestamps",
171
+ value: function getDiffBetweenTimestamps(a, b) {
172
+ var start = this.latencyTimestamps.get(a);
173
+ var end = this.latencyTimestamps.get(b);
174
+ if (start && end) {
175
+ return end - start;
176
+ }
177
+ return undefined;
178
+ }
179
+
180
+ /**
181
+ * Meeting Info Request
182
+ * @note Meeting Info request happen not just in the join phase. CA requires
183
+ * metrics around meeting info request that are only part of join phase.
184
+ * This internal.* event is used to track the real timestamps
185
+ * (when the actual request/response happen). This is because the actual CA event is
186
+ * sent inside the join method on the meeting object based on some logic, but that's not exactly when
187
+ * those events are actually fired. The logic only confirms that they have happened, and we send them over.
188
+ * @returns - latency
189
+ */
190
+ }, {
191
+ key: "getMeetingInfoReqResp",
192
+ value: function getMeetingInfoReqResp() {
193
+ return this.getDiffBetweenTimestamps('internal.client.meetinginfo.request', 'internal.client.meetinginfo.response');
194
+ }
195
+
196
+ /**
197
+ * Interstitial Time
198
+ * @returns - latency
199
+ */
200
+ }, {
201
+ key: "getShowInterstitialTime",
202
+ value: function getShowInterstitialTime() {
203
+ return this.getDiffBetweenTimestamps('client.interstitial-window.start-launch', 'internal.client.interstitial-window.click.joinbutton');
204
+ }
205
+
206
+ /**
207
+ * getU2CTime
208
+ * @returns - latency
209
+ */
210
+ }, {
211
+ key: "getU2CTime",
212
+ value: function getU2CTime() {
213
+ var u2cLatency = this.precomputedLatencies.get('internal.get.u2c.time');
214
+ return u2cLatency ? Math.floor(u2cLatency) : undefined;
215
+ }
216
+
217
+ /**
218
+ * Device Register Time
219
+ * @returns - latency
220
+ */
221
+ }, {
222
+ key: "getRegisterWDMDeviceJMT",
223
+ value: function getRegisterWDMDeviceJMT() {
224
+ return this.getDiffBetweenTimestamps('internal.register.device.request', 'internal.register.device.response');
225
+ }
226
+
227
+ /**
228
+ * Call Init Join Request
229
+ * @returns - latency
230
+ */
231
+ }, {
232
+ key: "getCallInitJoinReq",
233
+ value: function getCallInitJoinReq() {
234
+ return this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.request');
235
+ }
236
+
237
+ /**
238
+ * Locus Join Request
239
+ * @returns - latency
240
+ */
241
+ }, {
242
+ key: "getJoinReqResp",
243
+ value: function getJoinReqResp() {
244
+ return this.getDiffBetweenTimestamps('client.locus.join.request', 'client.locus.join.response');
245
+ }
246
+
247
+ /**
248
+ * Time taken to do turn discovery
249
+ * @returns - latency
250
+ */
251
+ }, {
252
+ key: "getTurnDiscoveryTime",
253
+ value: function getTurnDiscoveryTime() {
254
+ return this.getDiffBetweenTimestamps('internal.client.add-media.turn-discovery.start', 'internal.client.add-media.turn-discovery.end');
255
+ }
256
+
257
+ /**
258
+ * Local SDP Generated Remote SDP REceived
259
+ * @returns - latency
260
+ */
261
+ }, {
262
+ key: "getLocalSDPGenRemoteSDPRecv",
263
+ value: function getLocalSDPGenRemoteSDPRecv() {
264
+ return this.getDiffBetweenTimestamps('client.media-engine.local-sdp-generated', 'client.media-engine.remote-sdp-received');
265
+ }
266
+
267
+ /**
268
+ * ICE Setup Time
269
+ * @returns - latency
270
+ */
271
+ }, {
272
+ key: "getICESetupTime",
273
+ value: function getICESetupTime() {
274
+ return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');
275
+ }
276
+
277
+ /**
278
+ * Audio ICE time
279
+ * @returns - latency
280
+ */
281
+ }, {
282
+ key: "getAudioICESetupTime",
283
+ value: function getAudioICESetupTime() {
284
+ return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');
285
+ }
286
+
287
+ /**
288
+ * Video ICE Time
289
+ * @returns - latency
290
+ */
291
+ }, {
292
+ key: "getVideoICESetupTime",
293
+ value: function getVideoICESetupTime() {
294
+ return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');
295
+ }
296
+
297
+ /**
298
+ * Share ICE Time
299
+ * @returns - latency
300
+ */
301
+ }, {
302
+ key: "getShareICESetupTime",
303
+ value: function getShareICESetupTime() {
304
+ return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');
305
+ }
306
+
307
+ /**
308
+ * Stay Lobby Time
309
+ * @returns - latency
310
+ */
311
+ }, {
312
+ key: "getStayLobbyTime",
313
+ value: function getStayLobbyTime() {
314
+ return this.getDiffBetweenTimestamps('client.locus.join.response', 'internal.host.meeting.participant.admitted');
315
+ }
316
+
317
+ /**
318
+ * Page JMT
319
+ * @returns - latency
320
+ */
321
+ }, {
322
+ key: "getPageJMT",
323
+ value: function getPageJMT() {
324
+ return this.precomputedLatencies.get('internal.client.pageJMT') || undefined;
325
+ }
326
+
327
+ /**
328
+ * Download Time JMT
329
+ * @returns - latency
330
+ */
331
+ }, {
332
+ key: "getDownloadTimeJMT",
333
+ value: function getDownloadTimeJMT() {
334
+ return this.precomputedLatencies.get('internal.download.time') || undefined;
335
+ }
336
+
337
+ /**
338
+ * Click To Interstitial
339
+ * @returns - latency
340
+ */
341
+ }, {
342
+ key: "getClickToInterstitial",
343
+ value: function getClickToInterstitial() {
344
+ // for normal join (where green join button exists before interstitial, i.e reminder, space list etc)
345
+ if (this.latencyTimestamps.get('internal.client.meeting.click.joinbutton')) {
346
+ return this.getDiffBetweenTimestamps('internal.client.meeting.click.joinbutton', 'internal.client.meeting.interstitial-window.showed');
347
+ }
348
+
349
+ // for cross launch and guest flows
350
+ return this.precomputedLatencies.get('internal.click.to.interstitial') || undefined;
351
+ }
352
+
353
+ /**
354
+ * Interstitial To Join Ok
355
+ * @returns - latency
356
+ */
357
+ }, {
358
+ key: "getInterstitialToJoinOK",
359
+ value: function getInterstitialToJoinOK() {
360
+ return this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.response');
361
+ }
362
+
363
+ /**
364
+ * Call Init To MediaEngineReady
365
+ * @returns - latency
366
+ */
367
+ }, {
368
+ key: "getCallInitMediaEngineReady",
369
+ value: function getCallInitMediaEngineReady() {
370
+ return this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.media-engine.ready');
371
+ }
372
+
373
+ /**
374
+ * Interstitial To Media Ok
375
+ * @returns - latency
376
+ */
377
+ }, {
378
+ key: "getInterstitialToMediaOKJMT",
379
+ value: function getInterstitialToMediaOKJMT() {
380
+ var interstitialJoinClickTimestamp = this.latencyTimestamps.get('internal.client.interstitial-window.click.joinbutton');
381
+
382
+ // get the first timestamp
383
+ var connectedMedia = this.latencyTimestamps.get('client.ice.end');
384
+ var lobbyTime = this.getStayLobbyTime() || 0;
385
+ if (interstitialJoinClickTimestamp && connectedMedia) {
386
+ return connectedMedia - interstitialJoinClickTimestamp - lobbyTime;
387
+ }
388
+ return undefined;
389
+ }
390
+
391
+ /**
392
+ * Total JMT
393
+ * @returns - latency
394
+ */
395
+ }, {
396
+ key: "getTotalJMT",
397
+ value: function getTotalJMT() {
398
+ var clickToInterstitial = this.getClickToInterstitial();
399
+ var interstitialToJoinOk = this.getInterstitialToJoinOK();
400
+ if (clickToInterstitial && interstitialToJoinOk) {
401
+ return clickToInterstitial + interstitialToJoinOk;
402
+ }
403
+ return undefined;
404
+ }
405
+
406
+ /**
407
+ * Join Conf JMT
408
+ * @returns - latency
409
+ */
410
+ }, {
411
+ key: "getJoinConfJMT",
412
+ value: function getJoinConfJMT() {
413
+ var joinReqResp = this.getJoinReqResp();
414
+ var ICESetupTime = this.getICESetupTime();
415
+ if (joinReqResp && ICESetupTime) {
416
+ return joinReqResp + ICESetupTime;
417
+ }
418
+ return undefined;
419
+ }
420
+
421
+ /**
422
+ * Total Media JMT
423
+ * @returns - latency
424
+ */
425
+ }, {
426
+ key: "getTotalMediaJMT",
427
+ value: function getTotalMediaJMT() {
428
+ var clickToInterstitial = this.getClickToInterstitial();
429
+ var interstitialToJoinOk = this.getInterstitialToJoinOK();
430
+ var joinConfJMT = this.getJoinConfJMT();
431
+ var lobbyTime = this.getStayLobbyTime();
432
+ if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {
433
+ var _this$getMeeting;
434
+ var totalMediaJMT = clickToInterstitial + interstitialToJoinOk + joinConfJMT;
435
+ if ((_this$getMeeting = this.getMeeting()) !== null && _this$getMeeting !== void 0 && _this$getMeeting.allowMediaInLobby) {
436
+ return totalMediaJMT;
437
+ }
438
+ return totalMediaJMT - lobbyTime;
439
+ }
440
+ return undefined;
441
+ }
442
+
443
+ /**
444
+ * Client JMT
445
+ * @returns - latency
446
+ */
447
+ }, {
448
+ key: "getClientJMT",
449
+ value: function getClientJMT() {
450
+ var interstitialToJoinOk = this.getInterstitialToJoinOK();
451
+ var joinConfJMT = this.getJoinConfJMT();
452
+ if (interstitialToJoinOk && joinConfJMT) {
453
+ return interstitialToJoinOk - joinConfJMT;
454
+ }
455
+ return undefined;
456
+ }
457
+
458
+ /**
459
+ * Audio setup delay receive
460
+ */
461
+ }, {
462
+ key: "getAudioJoinRespRxStart",
463
+ value: function getAudioJoinRespRxStart() {
464
+ return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.rx.start');
465
+ }
466
+
467
+ /**
468
+ * Video setup delay receive
469
+ */
470
+ }, {
471
+ key: "getVideoJoinRespRxStart",
472
+ value: function getVideoJoinRespRxStart() {
473
+ return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.rx.start');
474
+ }
475
+
476
+ /**
477
+ * Audio setup delay transmit
478
+ */
479
+ }, {
480
+ key: "getAudioJoinRespTxStart",
481
+ value: function getAudioJoinRespTxStart() {
482
+ return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.tx.start');
483
+ }
484
+
485
+ /**
486
+ * Video setup delay transmit
487
+ */
488
+ }, {
489
+ key: "getVideoJoinRespTxStart",
490
+ value: function getVideoJoinRespTxStart() {
491
+ return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.tx.start');
492
+ }
493
+
494
+ /**
495
+ * Total latency for all other app api requests.
496
+ * Excludes meeting info, because it's measured separately.
497
+ */
498
+ }, {
499
+ key: "getOtherAppApiReqResp",
500
+ value: function getOtherAppApiReqResp() {
501
+ var otherAppApiJMT = this.precomputedLatencies.get('internal.other.app.api.time');
502
+ return otherAppApiJMT > 0 ? Math.floor(otherAppApiJMT) : undefined;
503
+ }
504
+ }]);
505
+ return CallDiagnosticLatencies;
506
+ }(_webexCore.WebexPlugin);
507
+ exports.default = CallDiagnosticLatencies;
508
+ //# sourceMappingURL=call-diagnostic-metrics-latencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CallDiagnosticLatencies","args","latencyTimestamps","precomputedLatencies","clear","meetingId","webex","meetings","meetingCollection","get","undefined","key","value","Date","getTime","options","setMeetingId","saveFirstTimestampOnly","set","overwrite","existingValue","callback","start","performance","now","finally","saveLatency","has","a","b","end","getDiffBetweenTimestamps","u2cLatency","Math","floor","interstitialJoinClickTimestamp","connectedMedia","lobbyTime","getStayLobbyTime","clickToInterstitial","getClickToInterstitial","interstitialToJoinOk","getInterstitialToJoinOK","joinReqResp","getJoinReqResp","ICESetupTime","getICESetupTime","joinConfJMT","getJoinConfJMT","totalMediaJMT","getMeeting","allowMediaInLobby","otherAppApiJMT","WebexPlugin"],"sources":["call-diagnostic-metrics-latencies.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport {MetricEventNames, PreComputedLatencies} from '../metrics.types';\n\n// we only care about client event and feature event for now\n\n/**\n * @description Helper class to store latencies timestamp and to calculate various latencies for CA.\n * @exports\n * @class CallDiagnosticLatencies\n */\nexport default class CallDiagnosticLatencies extends WebexPlugin {\n latencyTimestamps: Map<MetricEventNames, number>;\n precomputedLatencies: Map<PreComputedLatencies, number>;\n // meetingId that the current latencies are for\n private meetingId?: string;\n\n /**\n * @constructor\n */\n constructor(...args) {\n super(...args);\n this.latencyTimestamps = new Map();\n this.precomputedLatencies = new Map();\n }\n\n /**\n * Clear timestamps\n */\n public clearTimestamps() {\n this.latencyTimestamps.clear();\n }\n\n /**\n * Associate current latencies with a meeting id\n * @param meetingId\n */\n private setMeetingId(meetingId: string) {\n this.meetingId = meetingId;\n }\n\n /**\n * Returns the meeting object associated with current latencies\n * @returns meeting object\n */\n private getMeeting() {\n if (this.meetingId) {\n // @ts-ignore\n return this.webex.meetings.meetingCollection.get(this.meetingId);\n }\n\n return undefined;\n }\n\n /**\n * Store timestamp value\n * @param key - key\n * @param value -value\n * @throws\n * @returns\n */\n public saveTimestamp({\n key,\n value = new Date().getTime(),\n options = {},\n }: {\n key: MetricEventNames;\n value?: number;\n options?: {meetingId?: string};\n }) {\n // save the meetingId so we can use the meeting object in latency calculations if needed\n const {meetingId} = options;\n if (meetingId) {\n this.setMeetingId(meetingId);\n }\n // for some events we're only interested in the first timestamp not last\n // as these events can happen multiple times\n if (\n key === 'client.media.rx.start' ||\n key === 'client.media.tx.start' ||\n key === 'internal.client.meetinginfo.request' ||\n key === 'internal.client.meetinginfo.response'\n ) {\n this.saveFirstTimestampOnly(key, value);\n } else {\n this.latencyTimestamps.set(key, value);\n }\n }\n\n /**\n * Store precomputed latency value\n * @param key - key\n * @param value - value\n * @param overwrite - overwrite existing value or add it\n * @throws\n * @returns\n */\n public saveLatency(key: PreComputedLatencies, value: number, overwrite = true) {\n const existingValue = overwrite ? 0 : this.precomputedLatencies.get(key) || 0;\n this.precomputedLatencies.set(key, value + existingValue);\n }\n\n /**\n * Measure latency for a request\n * @param key - key\n * @param callback - callback for which you would like to measure latency\n * @param overwrite - overwite existing value or add to it\n * @returns\n */\n public measureLatency(\n callback: () => Promise<any>,\n key: PreComputedLatencies,\n overwrite = false\n ) {\n const start = performance.now();\n\n return callback().finally(() => {\n this.saveLatency(key, performance.now() - start, overwrite);\n });\n }\n\n /**\n * Store only the first timestamp value for the given key\n * @param key - key\n * @param value -value\n * @throws\n * @returns\n */\n saveFirstTimestampOnly(key: MetricEventNames, value: number = new Date().getTime()) {\n if (this.latencyTimestamps.has(key)) {\n return;\n }\n this.latencyTimestamps.set(key, value);\n }\n\n /**\n * Helper to calculate end - start\n * @param a start\n * @param b end\n * @returns latency\n */\n public getDiffBetweenTimestamps(a: MetricEventNames, b: MetricEventNames) {\n const start = this.latencyTimestamps.get(a);\n const end = this.latencyTimestamps.get(b);\n if (start && end) {\n return end - start;\n }\n\n return undefined;\n }\n\n /**\n * Meeting Info Request\n * @note Meeting Info request happen not just in the join phase. CA requires\n * metrics around meeting info request that are only part of join phase.\n * This internal.* event is used to track the real timestamps\n * (when the actual request/response happen). This is because the actual CA event is\n * sent inside the join method on the meeting object based on some logic, but that's not exactly when\n * those events are actually fired. The logic only confirms that they have happened, and we send them over.\n * @returns - latency\n */\n public getMeetingInfoReqResp() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.meetinginfo.request',\n 'internal.client.meetinginfo.response'\n );\n }\n\n /**\n * Interstitial Time\n * @returns - latency\n */\n public getShowInterstitialTime() {\n return this.getDiffBetweenTimestamps(\n 'client.interstitial-window.start-launch',\n 'internal.client.interstitial-window.click.joinbutton'\n );\n }\n\n /**\n * getU2CTime\n * @returns - latency\n */\n public getU2CTime() {\n const u2cLatency = this.precomputedLatencies.get('internal.get.u2c.time');\n\n return u2cLatency ? Math.floor(u2cLatency) : undefined;\n }\n\n /**\n * Device Register Time\n * @returns - latency\n */\n public getRegisterWDMDeviceJMT() {\n return this.getDiffBetweenTimestamps(\n 'internal.register.device.request',\n 'internal.register.device.response'\n );\n }\n\n /**\n * Call Init Join Request\n * @returns - latency\n */\n public getCallInitJoinReq() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.locus.join.request'\n );\n }\n\n /**\n * Locus Join Request\n * @returns - latency\n */\n public getJoinReqResp() {\n return this.getDiffBetweenTimestamps('client.locus.join.request', 'client.locus.join.response');\n }\n\n /**\n * Time taken to do turn discovery\n * @returns - latency\n */\n public getTurnDiscoveryTime() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.add-media.turn-discovery.start',\n 'internal.client.add-media.turn-discovery.end'\n );\n }\n\n /**\n * Local SDP Generated Remote SDP REceived\n * @returns - latency\n */\n public getLocalSDPGenRemoteSDPRecv() {\n return this.getDiffBetweenTimestamps(\n 'client.media-engine.local-sdp-generated',\n 'client.media-engine.remote-sdp-received'\n );\n }\n\n /**\n * ICE Setup Time\n * @returns - latency\n */\n public getICESetupTime() {\n return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');\n }\n\n /**\n * Audio ICE time\n * @returns - latency\n */\n public getAudioICESetupTime() {\n return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');\n }\n\n /**\n * Video ICE Time\n * @returns - latency\n */\n public getVideoICESetupTime() {\n return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');\n }\n\n /**\n * Share ICE Time\n * @returns - latency\n */\n public getShareICESetupTime() {\n return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');\n }\n\n /**\n * Stay Lobby Time\n * @returns - latency\n */\n public getStayLobbyTime() {\n return this.getDiffBetweenTimestamps(\n 'client.locus.join.response',\n 'internal.host.meeting.participant.admitted'\n );\n }\n\n /**\n * Page JMT\n * @returns - latency\n */\n public getPageJMT() {\n return this.precomputedLatencies.get('internal.client.pageJMT') || undefined;\n }\n\n /**\n * Download Time JMT\n * @returns - latency\n */\n public getDownloadTimeJMT() {\n return this.precomputedLatencies.get('internal.download.time') || undefined;\n }\n\n /**\n * Click To Interstitial\n * @returns - latency\n */\n public getClickToInterstitial() {\n // for normal join (where green join button exists before interstitial, i.e reminder, space list etc)\n if (this.latencyTimestamps.get('internal.client.meeting.click.joinbutton')) {\n return this.getDiffBetweenTimestamps(\n 'internal.client.meeting.click.joinbutton',\n 'internal.client.meeting.interstitial-window.showed'\n );\n }\n\n // for cross launch and guest flows\n return this.precomputedLatencies.get('internal.click.to.interstitial') || undefined;\n }\n\n /**\n * Interstitial To Join Ok\n * @returns - latency\n */\n public getInterstitialToJoinOK() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.locus.join.response'\n );\n }\n\n /**\n * Call Init To MediaEngineReady\n * @returns - latency\n */\n public getCallInitMediaEngineReady() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.media-engine.ready'\n );\n }\n\n /**\n * Interstitial To Media Ok\n * @returns - latency\n */\n public getInterstitialToMediaOKJMT() {\n const interstitialJoinClickTimestamp = this.latencyTimestamps.get(\n 'internal.client.interstitial-window.click.joinbutton'\n );\n\n // get the first timestamp\n const connectedMedia = this.latencyTimestamps.get('client.ice.end');\n\n const lobbyTime = this.getStayLobbyTime() || 0;\n\n if (interstitialJoinClickTimestamp && connectedMedia) {\n return connectedMedia - interstitialJoinClickTimestamp - lobbyTime;\n }\n\n return undefined;\n }\n\n /**\n * Total JMT\n * @returns - latency\n */\n public getTotalJMT() {\n const clickToInterstitial = this.getClickToInterstitial();\n const interstitialToJoinOk = this.getInterstitialToJoinOK();\n\n if (clickToInterstitial && interstitialToJoinOk) {\n return clickToInterstitial + interstitialToJoinOk;\n }\n\n return undefined;\n }\n\n /**\n * Join Conf JMT\n * @returns - latency\n */\n public getJoinConfJMT() {\n const joinReqResp = this.getJoinReqResp();\n const ICESetupTime = this.getICESetupTime();\n\n if (joinReqResp && ICESetupTime) {\n return joinReqResp + ICESetupTime;\n }\n\n return undefined;\n }\n\n /**\n * Total Media JMT\n * @returns - latency\n */\n public getTotalMediaJMT() {\n const clickToInterstitial = this.getClickToInterstitial();\n const interstitialToJoinOk = this.getInterstitialToJoinOK();\n const joinConfJMT = this.getJoinConfJMT();\n const lobbyTime = this.getStayLobbyTime();\n\n if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {\n const totalMediaJMT = clickToInterstitial + interstitialToJoinOk + joinConfJMT;\n if (this.getMeeting()?.allowMediaInLobby) {\n return totalMediaJMT;\n }\n\n return totalMediaJMT - lobbyTime;\n }\n\n return undefined;\n }\n\n /**\n * Client JMT\n * @returns - latency\n */\n public getClientJMT() {\n const interstitialToJoinOk = this.getInterstitialToJoinOK();\n const joinConfJMT = this.getJoinConfJMT();\n\n if (interstitialToJoinOk && joinConfJMT) {\n return interstitialToJoinOk - joinConfJMT;\n }\n\n return undefined;\n }\n\n /**\n * Audio setup delay receive\n */\n public getAudioJoinRespRxStart() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.rx.start');\n }\n\n /**\n * Video setup delay receive\n */\n public getVideoJoinRespRxStart() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.rx.start');\n }\n\n /**\n * Audio setup delay transmit\n */\n public getAudioJoinRespTxStart() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.tx.start');\n }\n\n /**\n * Video setup delay transmit\n */\n public getVideoJoinRespTxStart() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.tx.start');\n }\n\n /**\n * Total latency for all other app api requests.\n * Excludes meeting info, because it's measured separately.\n */\n public getOtherAppApiReqResp() {\n const otherAppApiJMT = this.precomputedLatencies.get('internal.other.app.api.time');\n\n return otherAppApiJMT > 0 ? Math.floor(otherAppApiJMT) : undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA;AAA8C;AAAA;AAI9C;AAEA;AACA;AACA;AACA;AACA;AAJA,IAKqBA,uBAAuB;EAAA;EAAA;EAG1C;;EAGA;AACF;AACA;EACE,mCAAqB;IAAA;IAAA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