@webex/internal-plugin-metrics 3.8.1 → 3.9.0-multi-llms.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +92 -14
  2. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
  3. package/dist/call-diagnostic/call-diagnostic-metrics.js +351 -48
  4. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
  5. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +21 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
  7. package/dist/call-diagnostic/config.js +3 -1
  8. package/dist/call-diagnostic/config.js.map +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/metrics.js +1 -1
  11. package/dist/metrics.types.js.map +1 -1
  12. package/dist/new-metrics.js +43 -1
  13. package/dist/new-metrics.js.map +1 -1
  14. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +23 -1
  15. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +177 -10
  16. package/dist/types/call-diagnostic/config.d.ts +2 -0
  17. package/dist/types/index.d.ts +2 -2
  18. package/dist/types/metrics.types.d.ts +19 -7
  19. package/dist/types/new-metrics.d.ts +19 -2
  20. package/package.json +12 -13
  21. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +104 -14
  22. package/src/call-diagnostic/call-diagnostic-metrics.ts +368 -25
  23. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +20 -0
  24. package/src/call-diagnostic/config.ts +3 -0
  25. package/src/index.ts +2 -0
  26. package/src/metrics.types.ts +26 -6
  27. package/src/new-metrics.ts +52 -1
  28. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +20 -1
  29. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +255 -0
  30. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +864 -39
  31. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +6 -0
  32. package/test/unit/spec/new-metrics.ts +67 -2
  33. package/test/unit/spec/prelogin-metrics-batcher.ts +72 -3
  34. package/dist/call-diagnostic-events-batcher.js +0 -60
  35. package/dist/call-diagnostic-events-batcher.js.map +0 -1
@@ -148,15 +148,27 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
148
148
  * @param b end
149
149
  * @returns latency
150
150
  */
151
- public getDiffBetweenTimestamps(a: MetricEventNames, b: MetricEventNames) {
151
+ public getDiffBetweenTimestamps(
152
+ a: MetricEventNames,
153
+ b: MetricEventNames,
154
+ clampValues?: {minimum?: number; maximum?: number}
155
+ ) {
152
156
  const start = this.latencyTimestamps.get(a);
153
157
  const end = this.latencyTimestamps.get(b);
154
158
 
155
- if (typeof start === 'number' && typeof end === 'number') {
156
- return end - start;
159
+ if (typeof start !== 'number' || typeof end !== 'number') {
160
+ return undefined;
157
161
  }
158
162
 
159
- return undefined;
163
+ const diff = end - start;
164
+
165
+ if (!clampValues) {
166
+ return diff;
167
+ }
168
+
169
+ const {minimum = 0, maximum} = clampValues;
170
+
171
+ return Math.min(maximum ?? Infinity, Math.max(diff, minimum));
160
172
  }
161
173
 
162
174
  /**
@@ -172,7 +184,8 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
172
184
  public getMeetingInfoReqResp() {
173
185
  return this.getDiffBetweenTimestamps(
174
186
  'internal.client.meetinginfo.request',
175
- 'internal.client.meetinginfo.response'
187
+ 'internal.client.meetinginfo.response',
188
+ {maximum: 1200000}
176
189
  );
177
190
  }
178
191
 
@@ -215,7 +228,8 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
215
228
  public getCallInitJoinReq() {
216
229
  return this.getDiffBetweenTimestamps(
217
230
  'internal.client.interstitial-window.click.joinbutton',
218
- 'client.locus.join.request'
231
+ 'client.locus.join.request',
232
+ {maximum: 1200000}
219
233
  );
220
234
  }
221
235
 
@@ -224,7 +238,11 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
224
238
  * @returns - latency
225
239
  */
226
240
  public getJoinReqResp() {
227
- return this.getDiffBetweenTimestamps('client.locus.join.request', 'client.locus.join.response');
241
+ return this.getDiffBetweenTimestamps(
242
+ 'client.locus.join.request',
243
+ 'client.locus.join.response',
244
+ {maximum: 1200000}
245
+ );
228
246
  }
229
247
 
230
248
  /**
@@ -245,7 +263,8 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
245
263
  public getLocalSDPGenRemoteSDPRecv() {
246
264
  return this.getDiffBetweenTimestamps(
247
265
  'client.media-engine.local-sdp-generated',
248
- 'client.media-engine.remote-sdp-received'
266
+ 'client.media-engine.remote-sdp-received',
267
+ {maximum: 1200000}
249
268
  );
250
269
  }
251
270
 
@@ -254,7 +273,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
254
273
  * @returns - latency
255
274
  */
256
275
  public getICESetupTime() {
257
- return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');
276
+ return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end', {maximum: 1200000});
258
277
  }
259
278
 
260
279
  /**
@@ -336,6 +355,30 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
336
355
  return undefined;
337
356
  }
338
357
 
358
+ /**
359
+ * Click To Interstitial With User Delay
360
+ * @returns - latency
361
+ */
362
+ public getClickToInterstitialWithUserDelay() {
363
+ // for normal join (where green join button exists before interstitial, i.e reminder, space list etc)
364
+ if (this.latencyTimestamps.get('internal.client.meeting.click.joinbutton')) {
365
+ return this.getDiffBetweenTimestamps(
366
+ 'internal.client.meeting.click.joinbutton',
367
+ 'internal.client.meeting.interstitial-window.showed'
368
+ );
369
+ }
370
+
371
+ const clickToInterstitialWithUserDelayLatency = this.precomputedLatencies.get(
372
+ 'internal.click.to.interstitial.with.user.delay'
373
+ );
374
+
375
+ if (typeof clickToInterstitialWithUserDelayLatency === 'number') {
376
+ return clickToInterstitialWithUserDelayLatency;
377
+ }
378
+
379
+ return undefined;
380
+ }
381
+
339
382
  /**
340
383
  * Interstitial To Join Ok
341
384
  * @returns - latency
@@ -354,7 +397,8 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
354
397
  public getCallInitMediaEngineReady() {
355
398
  return this.getDiffBetweenTimestamps(
356
399
  'internal.client.interstitial-window.click.joinbutton',
357
- 'client.media-engine.ready'
400
+ 'client.media-engine.ready',
401
+ {maximum: 1200000}
358
402
  );
359
403
  }
360
404
 
@@ -374,7 +418,9 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
374
418
  const lobbyTime = typeof lobbyTimeLatency === 'number' ? lobbyTimeLatency : 0;
375
419
 
376
420
  if (interstitialJoinClickTimestamp && connectedMedia) {
377
- return connectedMedia - interstitialJoinClickTimestamp - lobbyTime;
421
+ const interstitialToMediaOKJmt = connectedMedia - interstitialJoinClickTimestamp - lobbyTime;
422
+
423
+ return Math.max(0, interstitialToMediaOKJmt);
378
424
  }
379
425
 
380
426
  return undefined;
@@ -395,6 +441,24 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
395
441
  return undefined;
396
442
  }
397
443
 
444
+ /**
445
+ * Total JMT With User Delay
446
+ * @returns - latency
447
+ */
448
+ public getTotalJMTWithUserDelay() {
449
+ const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
450
+ const interstitialToJoinOk = this.getInterstitialToJoinOK();
451
+
452
+ if (
453
+ typeof clickToInterstitialWithUserDelay === 'number' &&
454
+ typeof interstitialToJoinOk === 'number'
455
+ ) {
456
+ return clickToInterstitialWithUserDelay + interstitialToJoinOk;
457
+ }
458
+
459
+ return undefined;
460
+ }
461
+
398
462
  /**
399
463
  * Join Conf JMT
400
464
  * @returns - latency
@@ -421,12 +485,28 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
421
485
  const lobbyTime = this.getStayLobbyTime();
422
486
 
423
487
  if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {
424
- const totalMediaJMT = clickToInterstitial + interstitialToJoinOk + joinConfJMT;
488
+ const totalMediaJMT = Math.max(0, clickToInterstitial + interstitialToJoinOk + joinConfJMT);
425
489
  if (this.getMeeting()?.allowMediaInLobby) {
426
490
  return totalMediaJMT;
427
491
  }
428
492
 
429
- return totalMediaJMT - lobbyTime;
493
+ return Math.max(0, totalMediaJMT - lobbyTime);
494
+ }
495
+
496
+ return undefined;
497
+ }
498
+
499
+ /**
500
+ * Total Media JMT With User Delay
501
+ * @returns - latency
502
+ */
503
+ public getTotalMediaJMTWithUserDelay() {
504
+ const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
505
+ const interstitialToJoinOk = this.getInterstitialToJoinOK();
506
+ const joinConfJMT = this.getJoinConfJMT();
507
+
508
+ if (clickToInterstitialWithUserDelay && interstitialToJoinOk && joinConfJMT) {
509
+ return Math.max(0, clickToInterstitialWithUserDelay + interstitialToJoinOk + joinConfJMT);
430
510
  }
431
511
 
432
512
  return undefined;
@@ -441,7 +521,7 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
441
521
  const joinConfJMT = this.getJoinConfJMT();
442
522
 
443
523
  if (typeof interstitialToJoinOk === 'number' && typeof joinConfJMT === 'number') {
444
- return interstitialToJoinOk - joinConfJMT;
524
+ return Math.max(0, interstitialToJoinOk - joinConfJMT);
445
525
  }
446
526
 
447
527
  return undefined;
@@ -486,6 +566,16 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
486
566
  return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.tx.start');
487
567
  }
488
568
 
569
+ /**
570
+ * Time from share initiation to share stop (ms).
571
+ */
572
+ public getShareDuration() {
573
+ return this.getDiffBetweenTimestamps(
574
+ 'internal.client.share.initiated',
575
+ 'internal.client.share.stopped'
576
+ );
577
+ }
578
+
489
579
  /**
490
580
  * Total latency for all exchange ci token.
491
581
  */