@webex/internal-plugin-metrics 3.12.0-next.11 → 3.12.0-next.12

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.
@@ -244,9 +244,12 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
244
244
  }, {
245
245
  key: "getCallInitJoinReq",
246
246
  value: function getCallInitJoinReq() {
247
- return this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.request', {
248
- maximum: 1200000
249
- });
247
+ var interstitialShowedToJoinReq = this.getDiffBetweenTimestamps('internal.client.meeting.interstitial-window.showed', 'client.locus.join.request');
248
+ var showInterstitialTime = this.getShowInterstitialTime() || 0;
249
+ if (typeof interstitialShowedToJoinReq !== 'number') {
250
+ return undefined;
251
+ }
252
+ return (0, _lodash.clamp)(interstitialShowedToJoinReq - showInterstitialTime, 0, 1200000);
250
253
  }
251
254
 
252
255
  /**
@@ -420,7 +423,12 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
420
423
  }, {
421
424
  key: "getInterstitialToJoinOK",
422
425
  value: function getInterstitialToJoinOK() {
423
- return this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.response');
426
+ var interstitialShowedToJoinResp = this.getDiffBetweenTimestamps('internal.client.meeting.interstitial-window.showed', 'client.locus.join.response');
427
+ var showInterstitialTime = this.getShowInterstitialTime() || 0;
428
+ if (typeof interstitialShowedToJoinResp !== 'number') {
429
+ return undefined;
430
+ }
431
+ return (0, _lodash.clamp)(interstitialShowedToJoinResp - showInterstitialTime, 0, this.MAX_INTEGER);
424
432
  }
425
433
 
426
434
  /**
@@ -440,10 +448,11 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
440
448
  }, {
441
449
  key: "getInterstitialToMediaOKJMT",
442
450
  value: function getInterstitialToMediaOKJMT() {
443
- var interstitialClickJoinToIceEnd = this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.ice.end');
451
+ var interstitialShowedToIceEnd = this.getDiffBetweenTimestamps('internal.client.meeting.interstitial-window.showed', 'client.ice.end');
452
+ var showInterstitialTime = this.getShowInterstitialTime() || 0;
444
453
  var stayLobbyTimeCappedByIceEnd = this.getStayLobbyTimeCappedBy('client.ice.end');
445
- if (typeof interstitialClickJoinToIceEnd === 'number' && typeof stayLobbyTimeCappedByIceEnd === 'number') {
446
- return (0, _lodash.clamp)(interstitialClickJoinToIceEnd - stayLobbyTimeCappedByIceEnd, 0, this.MAX_INTEGER);
454
+ if (typeof interstitialShowedToIceEnd === 'number' && typeof stayLobbyTimeCappedByIceEnd === 'number') {
455
+ return (0, _lodash.clamp)(interstitialShowedToIceEnd - showInterstitialTime - stayLobbyTimeCappedByIceEnd, 0, this.MAX_INTEGER);
447
456
  }
448
457
  return undefined;
449
458
  }
@@ -456,9 +465,10 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
456
465
  key: "getTotalJMT",
457
466
  value: function getTotalJMT() {
458
467
  var clickToInterstitial = this.getClickToInterstitial();
459
- var interstitialClickJoinToJoinLocusResponse = this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.response');
460
- if (typeof clickToInterstitial === 'number' && typeof interstitialClickJoinToJoinLocusResponse === 'number') {
461
- return (0, _lodash.clamp)(clickToInterstitial + interstitialClickJoinToJoinLocusResponse, 0, this.MAX_INTEGER);
468
+ var interstitialShowedToJoinLocusResponse = this.getDiffBetweenTimestamps('internal.client.meeting.interstitial-window.showed', 'client.locus.join.response');
469
+ var showInterstitialTime = this.getShowInterstitialTime() || 0;
470
+ if (typeof clickToInterstitial === 'number' && typeof interstitialShowedToJoinLocusResponse === 'number') {
471
+ return (0, _lodash.clamp)(clickToInterstitial + interstitialShowedToJoinLocusResponse - showInterstitialTime, 0, this.MAX_INTEGER);
462
472
  }
463
473
  return undefined;
464
474
  }
@@ -501,10 +511,11 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
501
511
  key: "getTotalMediaJMT",
502
512
  value: function getTotalMediaJMT() {
503
513
  var clickToInterstitial = this.getClickToInterstitial();
504
- var interstitialClickJoinToMediaEngineReady = this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.media-engine.ready');
514
+ var interstitialShowedToMediaEngineReady = this.getDiffBetweenTimestamps('internal.client.meeting.interstitial-window.showed', 'client.media-engine.ready');
515
+ var showInterstitialTime = this.getShowInterstitialTime() || 0;
505
516
  var stayLobbyTimeCappedByMediaEngineReady = this.getStayLobbyTimeCappedBy('client.media-engine.ready');
506
- if (typeof clickToInterstitial === 'number' && typeof interstitialClickJoinToMediaEngineReady === 'number' && typeof stayLobbyTimeCappedByMediaEngineReady === 'number') {
507
- return (0, _lodash.clamp)(clickToInterstitial + interstitialClickJoinToMediaEngineReady - stayLobbyTimeCappedByMediaEngineReady, 0, this.MAX_INTEGER);
517
+ if (typeof clickToInterstitial === 'number' && typeof interstitialShowedToMediaEngineReady === 'number' && typeof stayLobbyTimeCappedByMediaEngineReady === 'number') {
518
+ return (0, _lodash.clamp)(clickToInterstitial + interstitialShowedToMediaEngineReady - showInterstitialTime - stayLobbyTimeCappedByMediaEngineReady, 0, this.MAX_INTEGER);
508
519
  }
509
520
  return undefined;
510
521
  }
@@ -532,9 +543,10 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
532
543
  key: "getClientJMT",
533
544
  value: function getClientJMT() {
534
545
  var clickToInterstitialForClientJmt = this.precomputedLatencies.get('internal.click.to.interstitial.for.client.jmt');
535
- var interstitialJoinToLocusJoinRequest = this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.request');
536
- if (typeof clickToInterstitialForClientJmt === 'number' && typeof interstitialJoinToLocusJoinRequest === 'number') {
537
- return (0, _lodash.clamp)(clickToInterstitialForClientJmt + interstitialJoinToLocusJoinRequest, 0, this.MAX_INTEGER);
546
+ var interstitialShowedToLocusJoinRequest = this.getDiffBetweenTimestamps('internal.client.meeting.interstitial-window.showed', 'client.locus.join.request');
547
+ var showInterstitialTime = this.getShowInterstitialTime() || 0;
548
+ if (typeof clickToInterstitialForClientJmt === 'number' && typeof interstitialShowedToLocusJoinRequest === 'number') {
549
+ return (0, _lodash.clamp)(clickToInterstitialForClientJmt + interstitialShowedToLocusJoinRequest - showInterstitialTime, 0, this.MAX_INTEGER);
538
550
  }
539
551
  return undefined;
540
552
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_webexCore","require","_lodash","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","CallDiagnosticLatencies","exports","_WebexPlugin","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","latencyTimestamps","_map","precomputedLatencies","_inherits2","_createClass2","key","value","clearTimestamps","clear","setMeetingId","meetingId","getMeeting","webex","meetings","getBasicMeetingInformation","undefined","saveTimestamp","_ref","_ref$value","Date","getTime","_ref$options","options","saveFirstTimestampOnly","set","delete","saveLatency","accumulate","existingValue","get","measureLatency","callback","_this2","start","performance","now","finally","has","getDiffBetweenTimestamps","a","b","clampValues","end","diff","_ref2","_ref2$minimum","minimum","_ref2$maximum","maximum","MAX_INTEGER","clamp","getMeetingInfoReqResp","getShowInterstitialTime","getU2CTime","u2cLatency","Math","floor","getRegisterWDMDeviceJMT","getCallInitJoinReq","getJoinReqResp","getTurnDiscoveryTime","getLocalSDPGenRemoteSDPRecv","getICESetupTime","getAudioICESetupTime","getVideoICESetupTime","getShareICESetupTime","getStayLobbyTime","getStayLobbyTimeCappedBy","endTimestampKey","lobbyStartTimestamp","lobbyEndTimestamp","maximumEndTimestamp","endTimestamp","min","getPageJMT","latency","getDownloadTimeJMT","getClickToInterstitial","clickToInterstitialLatency","getClickToInterstitialWithUserDelay","clickToInterstitialWithUserDelayLatency","getInterstitialToJoinOK","getCallInitMediaEngineReady","getInterstitialToMediaOKJMT","interstitialClickJoinToIceEnd","stayLobbyTimeCappedByIceEnd","getTotalJMT","clickToInterstitial","interstitialClickJoinToJoinLocusResponse","getTotalJMTWithUserDelay","clickToInterstitialWithUserDelay","interstitialShowedToJoinLocusResponse","getJoinConfJMT","joinReqResp","ICESetupTime","getTotalMediaJMT","interstitialClickJoinToMediaEngineReady","stayLobbyTimeCappedByMediaEngineReady","getTotalMediaJMTWithUserDelay","interstitialShowedToMediaEngineReady","getClientJMT","clickToInterstitialForClientJmt","interstitialJoinToLocusJoinRequest","getAudioJoinRespRxStart","getVideoJoinRespRxStart","getReachabilityClustersReqResp","reachablityClusterReqResp","getAudioJoinRespTxStart","getVideoJoinRespTxStart","getShareDuration","getExchangeCITokenJMT","exchangeCITokenJMT","getRefreshCaptchaReqResp","refreshCaptchaReqResp","getDownloadIntelligenceModelsReqResp","downloadIntelligenceModelsReqResp","getOtherAppApiReqResp","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';\nimport {clamp} from 'lodash';\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 private MAX_INTEGER = 2147483647;\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 this.precomputedLatencies.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.getBasicMeetingInformation(this.meetingId);\n }\n\n return undefined;\n }\n\n /**\n * Store timestamp value\n * @param key - key\n * @param value - value\n * @param options - store options\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 key === 'client.media-engine.remote-sdp-received'\n ) {\n this.saveFirstTimestampOnly(key, value);\n } else {\n this.latencyTimestamps.set(key, value);\n // new offer/answer so reset the remote SDP timestamp\n if (key === 'client.media-engine.local-sdp-generated') {\n this.latencyTimestamps.delete('client.media-engine.remote-sdp-received');\n }\n }\n }\n\n /**\n * Store precomputed latency value\n * @param key - key\n * @param value - value\n * @param accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement\n * @throws\n * @returns\n */\n public saveLatency(key: PreComputedLatencies, value: number, accumulate = false) {\n const existingValue = accumulate ? this.precomputedLatencies.get(key) || 0 : 0;\n this.precomputedLatencies.set(key, value + existingValue);\n }\n\n /**\n * Measure latency for a request\n * @param callback - callback for which you would like to measure latency\n * @param key - key\n * @param accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement\n * @returns\n */\n public measureLatency(\n callback: () => Promise<unknown>,\n key: PreComputedLatencies,\n accumulate = false\n ) {\n const start = performance.now();\n\n return callback().finally(() => {\n this.saveLatency(key, performance.now() - start, accumulate);\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(\n a: MetricEventNames,\n b: MetricEventNames,\n clampValues?: {minimum?: number; maximum?: number}\n ) {\n const start = this.latencyTimestamps.get(a);\n const end = this.latencyTimestamps.get(b);\n\n if (typeof start !== 'number' || typeof end !== 'number') {\n return undefined;\n }\n\n const diff = end - start;\n\n const {minimum = 0, maximum = this.MAX_INTEGER} = clampValues || {};\n\n return clamp(diff, minimum, maximum);\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 {maximum: 1200000}\n );\n }\n\n /**\n * Interstitial Time\n * @returns - latency\n */\n public getShowInterstitialTime() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\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 typeof u2cLatency === 'number' ? 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 {maximum: 1200000}\n );\n }\n\n /**\n * Locus Join Request\n * @returns - latency\n */\n public getJoinReqResp() {\n return this.getDiffBetweenTimestamps(\n 'client.locus.join.request',\n 'client.locus.join.response',\n {maximum: 1200000}\n );\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 {maximum: 1200000}\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', {maximum: 1200000});\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('client.lobby.entered', 'client.lobby.exited');\n }\n\n /**\n * Stay lobby time capped by a certain timestamp.\n * This is to handle the case where the target end timestamp could happen before the lobby is exited,\n * for example media-engine.ready or client.ice.end\n * This is supposed to be called AFTER the end timestamp happens\n * @param endTimestampKey name of the target end event\n * @returns - latency\n */\n public getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames) {\n const lobbyStartTimestamp = this.latencyTimestamps.get('client.lobby.entered'); // might not exist (some meetings don't have lobby)\n\n if (typeof lobbyStartTimestamp !== 'number') {\n // no lobby in the meeting, stayLobbyTime is 0\n return 0;\n }\n\n const lobbyEndTimestamp = this.latencyTimestamps.get('client.lobby.exited'); // might not exist (if user still in lobby at the time of measurement)\n const maximumEndTimestamp = this.latencyTimestamps.get(endTimestampKey); // must exist\n\n if (typeof maximumEndTimestamp !== 'number') {\n // the provided timestamp to be used as a cap should exist, return undefined if it doesn't\n return undefined;\n }\n\n const endTimestamp =\n typeof lobbyEndTimestamp === 'number'\n ? Math.min(lobbyEndTimestamp, maximumEndTimestamp)\n : maximumEndTimestamp;\n\n return clamp(endTimestamp - lobbyStartTimestamp, 0, this.MAX_INTEGER);\n }\n\n /**\n * Page JMT\n * @returns - latency\n */\n public getPageJMT() {\n const latency = this.precomputedLatencies.get('internal.client.pageJMT');\n\n return typeof latency === 'number' ? clamp(latency, 0, this.MAX_INTEGER) : undefined;\n }\n\n /**\n * Download Time JMT\n * @returns - latency\n */\n public getDownloadTimeJMT() {\n const latency = this.precomputedLatencies.get('internal.download.time');\n\n return typeof latency === 'number' ? clamp(latency, 0, this.MAX_INTEGER) : undefined;\n }\n\n /**\n * Click To Interstitial\n * @returns - latency\n */\n public getClickToInterstitial() {\n const clickToInterstitialLatency = this.precomputedLatencies.get(\n 'internal.click.to.interstitial'\n );\n\n if (typeof clickToInterstitialLatency === 'number') {\n return clamp(clickToInterstitialLatency, 0, this.MAX_INTEGER);\n }\n\n return undefined;\n }\n\n /**\n * Click To Interstitial With User Delay\n * @returns - latency\n */\n public getClickToInterstitialWithUserDelay() {\n const clickToInterstitialWithUserDelayLatency = this.precomputedLatencies.get(\n 'internal.click.to.interstitial.with.user.delay'\n );\n\n if (typeof clickToInterstitialWithUserDelayLatency === 'number') {\n return clamp(clickToInterstitialWithUserDelayLatency, 0, this.MAX_INTEGER);\n }\n\n return 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.getInterstitialToMediaOKJMT();\n }\n\n /**\n * Interstitial To Media Ok\n * @returns - latency\n */\n public getInterstitialToMediaOKJMT() {\n const interstitialClickJoinToIceEnd = this.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.ice.end'\n );\n const stayLobbyTimeCappedByIceEnd = this.getStayLobbyTimeCappedBy('client.ice.end');\n\n if (\n typeof interstitialClickJoinToIceEnd === 'number' &&\n typeof stayLobbyTimeCappedByIceEnd === 'number'\n ) {\n return clamp(\n interstitialClickJoinToIceEnd - stayLobbyTimeCappedByIceEnd,\n 0,\n this.MAX_INTEGER\n );\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 interstitialClickJoinToJoinLocusResponse = this.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.locus.join.response'\n );\n\n if (\n typeof clickToInterstitial === 'number' &&\n typeof interstitialClickJoinToJoinLocusResponse === 'number'\n ) {\n return clamp(\n clickToInterstitial + interstitialClickJoinToJoinLocusResponse,\n 0,\n this.MAX_INTEGER\n );\n }\n\n return undefined;\n }\n\n /**\n * Total JMT With User Delay\n * @returns - latency\n */\n public getTotalJMTWithUserDelay() {\n const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();\n const interstitialShowedToJoinLocusResponse = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.locus.join.response'\n );\n\n if (\n typeof clickToInterstitialWithUserDelay === 'number' &&\n typeof interstitialShowedToJoinLocusResponse === 'number'\n ) {\n return clamp(\n clickToInterstitialWithUserDelay + interstitialShowedToJoinLocusResponse,\n 0,\n this.MAX_INTEGER\n );\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 clamp(joinReqResp + ICESetupTime, 0, this.MAX_INTEGER);\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 interstitialClickJoinToMediaEngineReady = this.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.media-engine.ready'\n );\n const stayLobbyTimeCappedByMediaEngineReady = this.getStayLobbyTimeCappedBy(\n 'client.media-engine.ready'\n );\n\n if (\n typeof clickToInterstitial === 'number' &&\n typeof interstitialClickJoinToMediaEngineReady === 'number' &&\n typeof stayLobbyTimeCappedByMediaEngineReady === 'number'\n ) {\n return clamp(\n clickToInterstitial +\n interstitialClickJoinToMediaEngineReady -\n stayLobbyTimeCappedByMediaEngineReady,\n 0,\n this.MAX_INTEGER\n );\n }\n\n return undefined;\n }\n\n /**\n * Total Media JMT With User Delay\n * @returns - latency\n */\n public getTotalMediaJMTWithUserDelay() {\n const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();\n const interstitialShowedToMediaEngineReady = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.media-engine.ready'\n );\n\n if (\n typeof clickToInterstitialWithUserDelay === 'number' &&\n typeof interstitialShowedToMediaEngineReady === 'number'\n ) {\n return clamp(\n clickToInterstitialWithUserDelay + interstitialShowedToMediaEngineReady,\n 0,\n this.MAX_INTEGER\n );\n }\n\n return undefined;\n }\n\n /**\n * Client JMT\n * @returns - latency\n */\n public getClientJMT() {\n const clickToInterstitialForClientJmt = this.precomputedLatencies.get(\n 'internal.click.to.interstitial.for.client.jmt'\n );\n const interstitialJoinToLocusJoinRequest = this.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.locus.join.request'\n );\n\n if (\n typeof clickToInterstitialForClientJmt === 'number' &&\n typeof interstitialJoinToLocusJoinRequest === 'number'\n ) {\n return clamp(\n clickToInterstitialForClientJmt + interstitialJoinToLocusJoinRequest,\n 0,\n this.MAX_INTEGER\n );\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 * Total latency for all get cluster request.\n */\n public getReachabilityClustersReqResp() {\n const reachablityClusterReqResp = this.precomputedLatencies.get('internal.get.cluster.time');\n\n return typeof reachablityClusterReqResp === 'number'\n ? clamp(Math.floor(reachablityClusterReqResp), 0, this.MAX_INTEGER)\n : undefined;\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 * Time from share initiation to share stop (ms).\n */\n public getShareDuration() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.share.initiated',\n 'internal.client.share.stopped'\n );\n }\n\n /**\n * Total latency for all exchange ci token.\n */\n public getExchangeCITokenJMT() {\n const exchangeCITokenJMT = this.precomputedLatencies.get('internal.exchange.ci.token.time');\n\n return typeof exchangeCITokenJMT === 'number'\n ? clamp(Math.floor(exchangeCITokenJMT), 0, this.MAX_INTEGER)\n : undefined;\n }\n\n /**\n * Total latency for all refresh captcha requests.\n */\n public getRefreshCaptchaReqResp() {\n const refreshCaptchaReqResp = this.precomputedLatencies.get('internal.refresh.captcha.time');\n\n return typeof refreshCaptchaReqResp === 'number'\n ? clamp(Math.floor(refreshCaptchaReqResp), 0, this.MAX_INTEGER)\n : undefined;\n }\n\n /**\n * Get the latency for downloading intelligence models.\n * @returns - latency\n */\n public getDownloadIntelligenceModelsReqResp() {\n const downloadIntelligenceModelsReqResp = this.precomputedLatencies.get(\n 'internal.api.fetch.intelligence.models'\n );\n\n return typeof downloadIntelligenceModelsReqResp === 'number'\n ? clamp(Math.floor(downloadIntelligenceModelsReqResp), 0, this.MAX_INTEGER)\n : undefined;\n }\n\n /**\n * Get the total latency for all other app API requests.\n * Excludes meeting info, because it's measured separately.\n * @returns - latency\n */\n public getOtherAppApiReqResp() {\n const otherAppApiJMT = this.precomputedLatencies.get('internal.other.app.api.time');\n\n return otherAppApiJMT > 0 ? clamp(Math.floor(otherAppApiJMT), 0, this.MAX_INTEGER) : undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAA6B,SAAAE,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UAH7B,4CACA;AAMA;AAEA;AACA;AACA;AACA;AACA;AAJA,IAKqB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AK,CAAC2D,iCAAiC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAClE,WAAW,CAAC,GACzElC,SAAS;IACf;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAAV,GAAA;IAAAC,KAAA,EAKA,SAAO8G,qBAAqBA,CAAA,EAAG;MAC7B,IAAMC,cAAc,GAAG,IAAI,CAACnH,oBAAoB,CAAC2B,GAAG,CAAC,6BAA6B,CAAC;MAEnF,OAAOwF,cAAc,GAAG,CAAC,GAAG,IAAAnE,aAAK,EAACK,IAAI,CAACC,KAAK,CAAC6D,cAAc,CAAC,EAAE,CAAC,EAAE,IAAI,CAACpE,WAAW,CAAC,GAAGlC,SAAS;IAChG;EAAC;AAAA,EAxpBkDuG,sBAAW","ignoreList":[]}
1
+ {"version":3,"names":["_webexCore","require","_lodash","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","CallDiagnosticLatencies","exports","_WebexPlugin","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","latencyTimestamps","_map","precomputedLatencies","_inherits2","_createClass2","key","value","clearTimestamps","clear","setMeetingId","meetingId","getMeeting","webex","meetings","getBasicMeetingInformation","undefined","saveTimestamp","_ref","_ref$value","Date","getTime","_ref$options","options","saveFirstTimestampOnly","set","delete","saveLatency","accumulate","existingValue","get","measureLatency","callback","_this2","start","performance","now","finally","has","getDiffBetweenTimestamps","a","b","clampValues","end","diff","_ref2","_ref2$minimum","minimum","_ref2$maximum","maximum","MAX_INTEGER","clamp","getMeetingInfoReqResp","getShowInterstitialTime","getU2CTime","u2cLatency","Math","floor","getRegisterWDMDeviceJMT","getCallInitJoinReq","interstitialShowedToJoinReq","showInterstitialTime","getJoinReqResp","getTurnDiscoveryTime","getLocalSDPGenRemoteSDPRecv","getICESetupTime","getAudioICESetupTime","getVideoICESetupTime","getShareICESetupTime","getStayLobbyTime","getStayLobbyTimeCappedBy","endTimestampKey","lobbyStartTimestamp","lobbyEndTimestamp","maximumEndTimestamp","endTimestamp","min","getPageJMT","latency","getDownloadTimeJMT","getClickToInterstitial","clickToInterstitialLatency","getClickToInterstitialWithUserDelay","clickToInterstitialWithUserDelayLatency","getInterstitialToJoinOK","interstitialShowedToJoinResp","getCallInitMediaEngineReady","getInterstitialToMediaOKJMT","interstitialShowedToIceEnd","stayLobbyTimeCappedByIceEnd","getTotalJMT","clickToInterstitial","interstitialShowedToJoinLocusResponse","getTotalJMTWithUserDelay","clickToInterstitialWithUserDelay","getJoinConfJMT","joinReqResp","ICESetupTime","getTotalMediaJMT","interstitialShowedToMediaEngineReady","stayLobbyTimeCappedByMediaEngineReady","getTotalMediaJMTWithUserDelay","getClientJMT","clickToInterstitialForClientJmt","interstitialShowedToLocusJoinRequest","getAudioJoinRespRxStart","getVideoJoinRespRxStart","getReachabilityClustersReqResp","reachablityClusterReqResp","getAudioJoinRespTxStart","getVideoJoinRespTxStart","getShareDuration","getExchangeCITokenJMT","exchangeCITokenJMT","getRefreshCaptchaReqResp","refreshCaptchaReqResp","getDownloadIntelligenceModelsReqResp","downloadIntelligenceModelsReqResp","getOtherAppApiReqResp","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';\nimport {clamp} from 'lodash';\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 private MAX_INTEGER = 2147483647;\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 this.precomputedLatencies.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.getBasicMeetingInformation(this.meetingId);\n }\n\n return undefined;\n }\n\n /**\n * Store timestamp value\n * @param key - key\n * @param value - value\n * @param options - store options\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 key === 'client.media-engine.remote-sdp-received'\n ) {\n this.saveFirstTimestampOnly(key, value);\n } else {\n this.latencyTimestamps.set(key, value);\n // new offer/answer so reset the remote SDP timestamp\n if (key === 'client.media-engine.local-sdp-generated') {\n this.latencyTimestamps.delete('client.media-engine.remote-sdp-received');\n }\n }\n }\n\n /**\n * Store precomputed latency value\n * @param key - key\n * @param value - value\n * @param accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement\n * @throws\n * @returns\n */\n public saveLatency(key: PreComputedLatencies, value: number, accumulate = false) {\n const existingValue = accumulate ? this.precomputedLatencies.get(key) || 0 : 0;\n this.precomputedLatencies.set(key, value + existingValue);\n }\n\n /**\n * Measure latency for a request\n * @param callback - callback for which you would like to measure latency\n * @param key - key\n * @param accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement\n * @returns\n */\n public measureLatency(\n callback: () => Promise<unknown>,\n key: PreComputedLatencies,\n accumulate = false\n ) {\n const start = performance.now();\n\n return callback().finally(() => {\n this.saveLatency(key, performance.now() - start, accumulate);\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(\n a: MetricEventNames,\n b: MetricEventNames,\n clampValues?: {minimum?: number; maximum?: number}\n ) {\n const start = this.latencyTimestamps.get(a);\n const end = this.latencyTimestamps.get(b);\n\n if (typeof start !== 'number' || typeof end !== 'number') {\n return undefined;\n }\n\n const diff = end - start;\n\n const {minimum = 0, maximum = this.MAX_INTEGER} = clampValues || {};\n\n return clamp(diff, minimum, maximum);\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 {maximum: 1200000}\n );\n }\n\n /**\n * Interstitial Time\n * @returns - latency\n */\n public getShowInterstitialTime() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\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 typeof u2cLatency === 'number' ? 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 const interstitialShowedToJoinReq = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.locus.join.request'\n );\n const showInterstitialTime = this.getShowInterstitialTime() || 0;\n\n if (typeof interstitialShowedToJoinReq !== 'number') {\n return undefined;\n }\n\n return clamp(interstitialShowedToJoinReq - showInterstitialTime, 0, 1200000);\n }\n\n /**\n * Locus Join Request\n * @returns - latency\n */\n public getJoinReqResp() {\n return this.getDiffBetweenTimestamps(\n 'client.locus.join.request',\n 'client.locus.join.response',\n {maximum: 1200000}\n );\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 {maximum: 1200000}\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', {maximum: 1200000});\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('client.lobby.entered', 'client.lobby.exited');\n }\n\n /**\n * Stay lobby time capped by a certain timestamp.\n * This is to handle the case where the target end timestamp could happen before the lobby is exited,\n * for example media-engine.ready or client.ice.end\n * This is supposed to be called AFTER the end timestamp happens\n * @param endTimestampKey name of the target end event\n * @returns - latency\n */\n public getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames) {\n const lobbyStartTimestamp = this.latencyTimestamps.get('client.lobby.entered'); // might not exist (some meetings don't have lobby)\n\n if (typeof lobbyStartTimestamp !== 'number') {\n // no lobby in the meeting, stayLobbyTime is 0\n return 0;\n }\n\n const lobbyEndTimestamp = this.latencyTimestamps.get('client.lobby.exited'); // might not exist (if user still in lobby at the time of measurement)\n const maximumEndTimestamp = this.latencyTimestamps.get(endTimestampKey); // must exist\n\n if (typeof maximumEndTimestamp !== 'number') {\n // the provided timestamp to be used as a cap should exist, return undefined if it doesn't\n return undefined;\n }\n\n const endTimestamp =\n typeof lobbyEndTimestamp === 'number'\n ? Math.min(lobbyEndTimestamp, maximumEndTimestamp)\n : maximumEndTimestamp;\n\n return clamp(endTimestamp - lobbyStartTimestamp, 0, this.MAX_INTEGER);\n }\n\n /**\n * Page JMT\n * @returns - latency\n */\n public getPageJMT() {\n const latency = this.precomputedLatencies.get('internal.client.pageJMT');\n\n return typeof latency === 'number' ? clamp(latency, 0, this.MAX_INTEGER) : undefined;\n }\n\n /**\n * Download Time JMT\n * @returns - latency\n */\n public getDownloadTimeJMT() {\n const latency = this.precomputedLatencies.get('internal.download.time');\n\n return typeof latency === 'number' ? clamp(latency, 0, this.MAX_INTEGER) : undefined;\n }\n\n /**\n * Click To Interstitial\n * @returns - latency\n */\n public getClickToInterstitial() {\n const clickToInterstitialLatency = this.precomputedLatencies.get(\n 'internal.click.to.interstitial'\n );\n\n if (typeof clickToInterstitialLatency === 'number') {\n return clamp(clickToInterstitialLatency, 0, this.MAX_INTEGER);\n }\n\n return undefined;\n }\n\n /**\n * Click To Interstitial With User Delay\n * @returns - latency\n */\n public getClickToInterstitialWithUserDelay() {\n const clickToInterstitialWithUserDelayLatency = this.precomputedLatencies.get(\n 'internal.click.to.interstitial.with.user.delay'\n );\n\n if (typeof clickToInterstitialWithUserDelayLatency === 'number') {\n return clamp(clickToInterstitialWithUserDelayLatency, 0, this.MAX_INTEGER);\n }\n\n return undefined;\n }\n\n /**\n * Interstitial To Join Ok\n * @returns - latency\n */\n public getInterstitialToJoinOK() {\n const interstitialShowedToJoinResp = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.locus.join.response'\n );\n const showInterstitialTime = this.getShowInterstitialTime() || 0;\n\n if (typeof interstitialShowedToJoinResp !== 'number') {\n return undefined;\n }\n\n return clamp(interstitialShowedToJoinResp - showInterstitialTime, 0, this.MAX_INTEGER);\n }\n\n /**\n * Call Init To MediaEngineReady\n * @returns - latency\n */\n public getCallInitMediaEngineReady() {\n return this.getInterstitialToMediaOKJMT();\n }\n\n /**\n * Interstitial To Media Ok\n * @returns - latency\n */\n public getInterstitialToMediaOKJMT() {\n const interstitialShowedToIceEnd = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.ice.end'\n );\n const showInterstitialTime = this.getShowInterstitialTime() || 0;\n const stayLobbyTimeCappedByIceEnd = this.getStayLobbyTimeCappedBy('client.ice.end');\n\n if (\n typeof interstitialShowedToIceEnd === 'number' &&\n typeof stayLobbyTimeCappedByIceEnd === 'number'\n ) {\n return clamp(\n interstitialShowedToIceEnd - showInterstitialTime - stayLobbyTimeCappedByIceEnd,\n 0,\n this.MAX_INTEGER\n );\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 interstitialShowedToJoinLocusResponse = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.locus.join.response'\n );\n const showInterstitialTime = this.getShowInterstitialTime() || 0;\n\n if (\n typeof clickToInterstitial === 'number' &&\n typeof interstitialShowedToJoinLocusResponse === 'number'\n ) {\n return clamp(\n clickToInterstitial + interstitialShowedToJoinLocusResponse - showInterstitialTime,\n 0,\n this.MAX_INTEGER\n );\n }\n\n return undefined;\n }\n\n /**\n * Total JMT With User Delay\n * @returns - latency\n */\n public getTotalJMTWithUserDelay() {\n const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();\n const interstitialShowedToJoinLocusResponse = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.locus.join.response'\n );\n\n if (\n typeof clickToInterstitialWithUserDelay === 'number' &&\n typeof interstitialShowedToJoinLocusResponse === 'number'\n ) {\n return clamp(\n clickToInterstitialWithUserDelay + interstitialShowedToJoinLocusResponse,\n 0,\n this.MAX_INTEGER\n );\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 clamp(joinReqResp + ICESetupTime, 0, this.MAX_INTEGER);\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 interstitialShowedToMediaEngineReady = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.media-engine.ready'\n );\n const showInterstitialTime = this.getShowInterstitialTime() || 0;\n const stayLobbyTimeCappedByMediaEngineReady = this.getStayLobbyTimeCappedBy(\n 'client.media-engine.ready'\n );\n\n if (\n typeof clickToInterstitial === 'number' &&\n typeof interstitialShowedToMediaEngineReady === 'number' &&\n typeof stayLobbyTimeCappedByMediaEngineReady === 'number'\n ) {\n return clamp(\n clickToInterstitial +\n interstitialShowedToMediaEngineReady -\n showInterstitialTime -\n stayLobbyTimeCappedByMediaEngineReady,\n 0,\n this.MAX_INTEGER\n );\n }\n\n return undefined;\n }\n\n /**\n * Total Media JMT With User Delay\n * @returns - latency\n */\n public getTotalMediaJMTWithUserDelay() {\n const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();\n const interstitialShowedToMediaEngineReady = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.media-engine.ready'\n );\n\n if (\n typeof clickToInterstitialWithUserDelay === 'number' &&\n typeof interstitialShowedToMediaEngineReady === 'number'\n ) {\n return clamp(\n clickToInterstitialWithUserDelay + interstitialShowedToMediaEngineReady,\n 0,\n this.MAX_INTEGER\n );\n }\n\n return undefined;\n }\n\n /**\n * Client JMT\n * @returns - latency\n */\n public getClientJMT() {\n const clickToInterstitialForClientJmt = this.precomputedLatencies.get(\n 'internal.click.to.interstitial.for.client.jmt'\n );\n const interstitialShowedToLocusJoinRequest = this.getDiffBetweenTimestamps(\n 'internal.client.meeting.interstitial-window.showed',\n 'client.locus.join.request'\n );\n const showInterstitialTime = this.getShowInterstitialTime() || 0;\n\n if (\n typeof clickToInterstitialForClientJmt === 'number' &&\n typeof interstitialShowedToLocusJoinRequest === 'number'\n ) {\n return clamp(\n clickToInterstitialForClientJmt +\n interstitialShowedToLocusJoinRequest -\n showInterstitialTime,\n 0,\n this.MAX_INTEGER\n );\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 * Total latency for all get cluster request.\n */\n public getReachabilityClustersReqResp() {\n const reachablityClusterReqResp = this.precomputedLatencies.get('internal.get.cluster.time');\n\n return typeof reachablityClusterReqResp === 'number'\n ? clamp(Math.floor(reachablityClusterReqResp), 0, this.MAX_INTEGER)\n : undefined;\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 * Time from share initiation to share stop (ms).\n */\n public getShareDuration() {\n return this.getDiffBetweenTimestamps(\n 'internal.client.share.initiated',\n 'internal.client.share.stopped'\n );\n }\n\n /**\n * Total latency for all exchange ci token.\n */\n public getExchangeCITokenJMT() {\n const exchangeCITokenJMT = this.precomputedLatencies.get('internal.exchange.ci.token.time');\n\n return typeof exchangeCITokenJMT === 'number'\n ? clamp(Math.floor(exchangeCITokenJMT), 0, this.MAX_INTEGER)\n : undefined;\n }\n\n /**\n * Total latency for all refresh captcha requests.\n */\n public getRefreshCaptchaReqResp() {\n const refreshCaptchaReqResp = this.precomputedLatencies.get('internal.refresh.captcha.time');\n\n return typeof refreshCaptchaReqResp === 'number'\n ? clamp(Math.floor(refreshCaptchaReqResp), 0, this.MAX_INTEGER)\n : undefined;\n }\n\n /**\n * Get the latency for downloading intelligence models.\n * @returns - latency\n */\n public getDownloadIntelligenceModelsReqResp() {\n const downloadIntelligenceModelsReqResp = this.precomputedLatencies.get(\n 'internal.api.fetch.intelligence.models'\n );\n\n return typeof downloadIntelligenceModelsReqResp === 'number'\n ? clamp(Math.floor(downloadIntelligenceModelsReqResp), 0, this.MAX_INTEGER)\n : undefined;\n }\n\n /**\n * Get the total latency for all other app API requests.\n * Excludes meeting info, because it's measured separately.\n * @returns - latency\n */\n public getOtherAppApiReqResp() {\n const otherAppApiJMT = this.precomputedLatencies.get('internal.other.app.api.time');\n\n return otherAppApiJMT > 0 ? clamp(Math.floor(otherAppApiJMT), 0, this.MAX_INTEGER) : undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;A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AO6G,oCAAoCA,CAAA,EAAG;MAC5C,IAAMC,iCAAiC,GAAG,IAAI,CAAClH,oBAAoB,CAAC2B,GAAG,CACrE,wCACF,CAAC;MAED,OAAO,OAAOuF,iCAAiC,KAAK,QAAQ,GACxD,IAAAlE,aAAK,EAACK,IAAI,CAACC,KAAK,CAAC4D,iCAAiC,CAAC,EAAE,CAAC,EAAE,IAAI,CAACnE,WAAW,CAAC,GACzElC,SAAS;IACf;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAAV,GAAA;IAAAC,KAAA,EAKA,SAAO+G,qBAAqBA,CAAA,EAAG;MAC7B,IAAMC,cAAc,GAAG,IAAI,CAACpH,oBAAoB,CAAC2B,GAAG,CAAC,6BAA6B,CAAC;MAEnF,OAAOyF,cAAc,GAAG,CAAC,GAAG,IAAApE,aAAK,EAACK,IAAI,CAACC,KAAK,CAAC8D,cAAc,CAAC,EAAE,CAAC,EAAE,IAAI,CAACrE,WAAW,CAAC,GAAGlC,SAAS;IAChG;EAAC;AAAA,EA5qBkDwG,sBAAW","ignoreList":[]}
package/dist/metrics.js CHANGED
@@ -147,7 +147,7 @@ var Metrics = _webexCore.WebexPlugin.extend({
147
147
  }
148
148
  });
149
149
  },
150
- version: "3.12.0-next.11"
150
+ version: "3.12.0-next.12"
151
151
  });
152
152
  var _default = exports.default = Metrics;
153
153
  //# sourceMappingURL=metrics.js.map
package/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  "@webex/common-timers": "3.11.0-next.1",
41
41
  "@webex/test-helper-chai": "3.11.0-next.1",
42
42
  "@webex/test-helper-mock-webex": "3.11.0-next.1",
43
- "@webex/webex-core": "3.12.0-next.11",
43
+ "@webex/webex-core": "3.12.0-next.12",
44
44
  "ip-anonymize": "^0.1.0",
45
45
  "lodash": "^4.17.21",
46
46
  "uuid": "^3.3.2"
@@ -53,5 +53,5 @@
53
53
  "test:style": "eslint ./src/**/*.*",
54
54
  "test:unit": "webex-legacy-tools test --unit --runner mocha"
55
55
  },
56
- "version": "3.12.0-next.11"
56
+ "version": "3.12.0-next.12"
57
57
  }
@@ -224,11 +224,17 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
224
224
  * @returns - latency
225
225
  */
226
226
  public getCallInitJoinReq() {
227
- return this.getDiffBetweenTimestamps(
228
- 'internal.client.interstitial-window.click.joinbutton',
229
- 'client.locus.join.request',
230
- {maximum: 1200000}
227
+ const interstitialShowedToJoinReq = this.getDiffBetweenTimestamps(
228
+ 'internal.client.meeting.interstitial-window.showed',
229
+ 'client.locus.join.request'
231
230
  );
231
+ const showInterstitialTime = this.getShowInterstitialTime() || 0;
232
+
233
+ if (typeof interstitialShowedToJoinReq !== 'number') {
234
+ return undefined;
235
+ }
236
+
237
+ return clamp(interstitialShowedToJoinReq - showInterstitialTime, 0, 1200000);
232
238
  }
233
239
 
234
240
  /**
@@ -395,10 +401,17 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
395
401
  * @returns - latency
396
402
  */
397
403
  public getInterstitialToJoinOK() {
398
- return this.getDiffBetweenTimestamps(
399
- 'internal.client.interstitial-window.click.joinbutton',
404
+ const interstitialShowedToJoinResp = this.getDiffBetweenTimestamps(
405
+ 'internal.client.meeting.interstitial-window.showed',
400
406
  'client.locus.join.response'
401
407
  );
408
+ const showInterstitialTime = this.getShowInterstitialTime() || 0;
409
+
410
+ if (typeof interstitialShowedToJoinResp !== 'number') {
411
+ return undefined;
412
+ }
413
+
414
+ return clamp(interstitialShowedToJoinResp - showInterstitialTime, 0, this.MAX_INTEGER);
402
415
  }
403
416
 
404
417
  /**
@@ -414,18 +427,19 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
414
427
  * @returns - latency
415
428
  */
416
429
  public getInterstitialToMediaOKJMT() {
417
- const interstitialClickJoinToIceEnd = this.getDiffBetweenTimestamps(
418
- 'internal.client.interstitial-window.click.joinbutton',
430
+ const interstitialShowedToIceEnd = this.getDiffBetweenTimestamps(
431
+ 'internal.client.meeting.interstitial-window.showed',
419
432
  'client.ice.end'
420
433
  );
434
+ const showInterstitialTime = this.getShowInterstitialTime() || 0;
421
435
  const stayLobbyTimeCappedByIceEnd = this.getStayLobbyTimeCappedBy('client.ice.end');
422
436
 
423
437
  if (
424
- typeof interstitialClickJoinToIceEnd === 'number' &&
438
+ typeof interstitialShowedToIceEnd === 'number' &&
425
439
  typeof stayLobbyTimeCappedByIceEnd === 'number'
426
440
  ) {
427
441
  return clamp(
428
- interstitialClickJoinToIceEnd - stayLobbyTimeCappedByIceEnd,
442
+ interstitialShowedToIceEnd - showInterstitialTime - stayLobbyTimeCappedByIceEnd,
429
443
  0,
430
444
  this.MAX_INTEGER
431
445
  );
@@ -440,17 +454,18 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
440
454
  */
441
455
  public getTotalJMT() {
442
456
  const clickToInterstitial = this.getClickToInterstitial();
443
- const interstitialClickJoinToJoinLocusResponse = this.getDiffBetweenTimestamps(
444
- 'internal.client.interstitial-window.click.joinbutton',
457
+ const interstitialShowedToJoinLocusResponse = this.getDiffBetweenTimestamps(
458
+ 'internal.client.meeting.interstitial-window.showed',
445
459
  'client.locus.join.response'
446
460
  );
461
+ const showInterstitialTime = this.getShowInterstitialTime() || 0;
447
462
 
448
463
  if (
449
464
  typeof clickToInterstitial === 'number' &&
450
- typeof interstitialClickJoinToJoinLocusResponse === 'number'
465
+ typeof interstitialShowedToJoinLocusResponse === 'number'
451
466
  ) {
452
467
  return clamp(
453
- clickToInterstitial + interstitialClickJoinToJoinLocusResponse,
468
+ clickToInterstitial + interstitialShowedToJoinLocusResponse - showInterstitialTime,
454
469
  0,
455
470
  this.MAX_INTEGER
456
471
  );
@@ -505,22 +520,24 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
505
520
  */
506
521
  public getTotalMediaJMT() {
507
522
  const clickToInterstitial = this.getClickToInterstitial();
508
- const interstitialClickJoinToMediaEngineReady = this.getDiffBetweenTimestamps(
509
- 'internal.client.interstitial-window.click.joinbutton',
523
+ const interstitialShowedToMediaEngineReady = this.getDiffBetweenTimestamps(
524
+ 'internal.client.meeting.interstitial-window.showed',
510
525
  'client.media-engine.ready'
511
526
  );
527
+ const showInterstitialTime = this.getShowInterstitialTime() || 0;
512
528
  const stayLobbyTimeCappedByMediaEngineReady = this.getStayLobbyTimeCappedBy(
513
529
  'client.media-engine.ready'
514
530
  );
515
531
 
516
532
  if (
517
533
  typeof clickToInterstitial === 'number' &&
518
- typeof interstitialClickJoinToMediaEngineReady === 'number' &&
534
+ typeof interstitialShowedToMediaEngineReady === 'number' &&
519
535
  typeof stayLobbyTimeCappedByMediaEngineReady === 'number'
520
536
  ) {
521
537
  return clamp(
522
538
  clickToInterstitial +
523
- interstitialClickJoinToMediaEngineReady -
539
+ interstitialShowedToMediaEngineReady -
540
+ showInterstitialTime -
524
541
  stayLobbyTimeCappedByMediaEngineReady,
525
542
  0,
526
543
  this.MAX_INTEGER
@@ -563,17 +580,20 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
563
580
  const clickToInterstitialForClientJmt = this.precomputedLatencies.get(
564
581
  'internal.click.to.interstitial.for.client.jmt'
565
582
  );
566
- const interstitialJoinToLocusJoinRequest = this.getDiffBetweenTimestamps(
567
- 'internal.client.interstitial-window.click.joinbutton',
583
+ const interstitialShowedToLocusJoinRequest = this.getDiffBetweenTimestamps(
584
+ 'internal.client.meeting.interstitial-window.showed',
568
585
  'client.locus.join.request'
569
586
  );
587
+ const showInterstitialTime = this.getShowInterstitialTime() || 0;
570
588
 
571
589
  if (
572
590
  typeof clickToInterstitialForClientJmt === 'number' &&
573
- typeof interstitialJoinToLocusJoinRequest === 'number'
591
+ typeof interstitialShowedToLocusJoinRequest === 'number'
574
592
  ) {
575
593
  return clamp(
576
- clickToInterstitialForClientJmt + interstitialJoinToLocusJoinRequest,
594
+ clickToInterstitialForClientJmt +
595
+ interstitialShowedToLocusJoinRequest -
596
+ showInterstitialTime,
577
597
  0,
578
598
  this.MAX_INTEGER
579
599
  );
@@ -192,6 +192,12 @@ describe('plugin-metrics', () => {
192
192
  webex.internal.newMetrics.callDiagnosticLatencies.getTotalJMTWithUserDelay = sinon
193
193
  .stub()
194
194
  .returns(64);
195
+ webex.internal.newMetrics.callDiagnosticLatencies.getInterstitialToJoinOK = sinon
196
+ .stub()
197
+ .returns(10);
198
+ webex.internal.newMetrics.callDiagnosticLatencies.getTotalJMT = sinon
199
+ .stub()
200
+ .returns(20);
195
201
  const promise = webex.internal.newMetrics.callDiagnosticMetrics.submitToCallDiagnostics(
196
202
  //@ts-ignore
197
203
  {event: {name: 'client.locus.join.response'}}
@@ -349,6 +355,9 @@ describe('plugin-metrics', () => {
349
355
  webex.internal.newMetrics.callDiagnosticLatencies.getStayLobbyTimeCappedBy = sinon
350
356
  .stub()
351
357
  .returns(1);
358
+ webex.internal.newMetrics.callDiagnosticLatencies.getTotalMediaJMT = sinon
359
+ .stub()
360
+ .returns(44);
352
361
  webex.internal.newMetrics.callDiagnosticLatencies.getTotalMediaJMTWithUserDelay = sinon
353
362
  .stub()
354
363
  .returns(43);
@@ -412,8 +412,10 @@ describe('internal-plugin-metrics', () => {
412
412
  });
413
413
 
414
414
  it('calculates getCallInitJoinReq correctly', () => {
415
+ cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 5});
415
416
  cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
416
417
  cdl.saveTimestamp({key: 'client.locus.join.request', value: 20});
418
+ // showedToJoinReq = 20-5 = 15, showInterstitialTime = 10-5 = 5, result = 15-5 = 10
417
419
  assert.deepEqual(cdl.getCallInitJoinReq(), 10);
418
420
  });
419
421
 
@@ -604,6 +606,10 @@ describe('internal-plugin-metrics', () => {
604
606
  });
605
607
 
606
608
  it('calculates getInterstitialToJoinOK correctly', () => {
609
+ cdl.saveTimestamp({
610
+ key: 'internal.client.meeting.interstitial-window.showed',
611
+ value: 5,
612
+ });
607
613
  cdl.saveTimestamp({
608
614
  key: 'internal.client.interstitial-window.click.joinbutton',
609
615
  value: 10,
@@ -612,12 +618,13 @@ describe('internal-plugin-metrics', () => {
612
618
  key: 'client.locus.join.response',
613
619
  value: 20,
614
620
  });
621
+ // showedToJoinResp = 20-5 = 15, showInterstitialTime = 10-5 = 5, result = 15-5 = 10
615
622
  assert.deepEqual(cdl.getInterstitialToJoinOK(), 10);
616
623
  });
617
624
 
618
625
  it('calculates getInterstitialToJoinOK correctly when one value is not a number', () => {
619
626
  cdl.saveTimestamp({
620
- key: 'internal.client.interstitial-window.click.joinbutton',
627
+ key: 'internal.client.meeting.interstitial-window.showed',
621
628
  value: 'ten' as unknown as number,
622
629
  });
623
630
  cdl.saveTimestamp({
@@ -634,33 +641,47 @@ describe('internal-plugin-metrics', () => {
634
641
 
635
642
  it('calculates getTotalJMT correctly', () => {
636
643
  cdl.saveLatency('internal.click.to.interstitial', 10);
644
+ cdl.saveTimestamp({
645
+ key: 'internal.client.meeting.click.joinbutton',
646
+ value: 10,
647
+ });
648
+ cdl.saveTimestamp({
649
+ key: 'internal.client.meeting.interstitial-window.showed',
650
+ value: 20,
651
+ });
637
652
  cdl.saveTimestamp({
638
653
  key: 'internal.client.interstitial-window.click.joinbutton',
639
- value: 5,
654
+ value: 25,
640
655
  });
641
656
  cdl.saveTimestamp({
642
657
  key: 'client.locus.join.response',
643
658
  value: 40,
644
659
  });
645
- assert.deepEqual(cdl.getTotalJMT(), 45);
660
+ // clickToInterstitial = 20-10 = 10
661
+ // showedToJoinLocusResponse = 40-20 = 20
662
+ // showInterstitialTime = 25-20 = 5
663
+ // total = 10 + 20 - 5 = 25
664
+ assert.deepEqual(cdl.getTotalJMT(), 25);
646
665
  });
647
666
 
648
667
  it('calculates getTotalJMT correctly when clickToInterstitial is 0', () => {
649
668
  cdl.saveLatency('internal.click.to.interstitial', 0);
650
669
  cdl.saveTimestamp({
651
- key: 'internal.client.interstitial-window.click.joinbutton',
670
+ key: 'internal.client.meeting.interstitial-window.showed',
652
671
  value: 20,
653
672
  });
654
673
  cdl.saveTimestamp({
655
674
  key: 'client.locus.join.response',
656
675
  value: 40,
657
676
  });
677
+ // showedToJoinLocusResponse = 40-20 = 20, showInterstitialTime = 0
678
+ // total = 0 + 20 - 0 = 20
658
679
  assert.deepEqual(cdl.getTotalJMT(), 20);
659
680
  });
660
681
 
661
682
  it('calculates getTotalJMT correctly when interstitialClickJoinToJoinLocusResponse is 0', () => {
662
683
  cdl.saveTimestamp({
663
- key: 'internal.client.interstitial-window.click.joinbutton',
684
+ key: 'internal.client.meeting.interstitial-window.showed',
664
685
  value: 40,
665
686
  });
666
687
  cdl.saveLatency('internal.click.to.interstitial', 12);
@@ -668,12 +689,14 @@ describe('internal-plugin-metrics', () => {
668
689
  key: 'client.locus.join.response',
669
690
  value: 40,
670
691
  });
692
+ // showedToJoinLocusResponse = 0, showInterstitialTime = 0
693
+ // total = 12 + 0 - 0 = 12
671
694
  assert.deepEqual(cdl.getTotalJMT(), 12);
672
695
  });
673
696
 
674
697
  it('calculates getTotalJMT correctly when both clickToInterstitial and interstitialClickJoinToJoinLocusResponse are 0', () => {
675
698
  cdl.saveTimestamp({
676
- key: 'internal.client.interstitial-window.click.joinbutton',
699
+ key: 'internal.client.meeting.interstitial-window.showed',
677
700
  value: 40,
678
701
  });
679
702
  cdl.saveLatency('internal.click.to.interstitial', 0);
@@ -686,7 +709,7 @@ describe('internal-plugin-metrics', () => {
686
709
 
687
710
  it('calculates getTotalJMT correctly when both clickToInterstitial is not a number', () => {
688
711
  cdl.saveTimestamp({
689
- key: 'internal.client.interstitial-window.click.joinbutton',
712
+ key: 'internal.client.meeting.interstitial-window.showed',
690
713
  value: 40,
691
714
  });
692
715
  cdl.saveLatency('internal.click.to.interstitial', 'eleven' as unknown as number);
@@ -699,7 +722,7 @@ describe('internal-plugin-metrics', () => {
699
722
 
700
723
  it('calculates getTotalJMT correctly when it is greater than MAX_INTEGER', () => {
701
724
  cdl.saveTimestamp({
702
- key: 'internal.client.interstitial-window.click.joinbutton',
725
+ key: 'internal.client.meeting.interstitial-window.showed',
703
726
  value: 5,
704
727
  });
705
728
  cdl.saveTimestamp({
@@ -794,42 +817,49 @@ describe('internal-plugin-metrics', () => {
794
817
  it('calculates getTotalMediaJMT correctly with lobby exiting before media-engine.ready', () => {
795
818
  cdl.saveLatency('internal.click.to.interstitial', 3);
796
819
  // clickToInterstitial = 3
820
+ cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
797
821
  cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
798
822
  cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
799
- // interstitialClickJoinToMediaEngineReady = 50 - 10 = 40
823
+ // interstitialShowedToMediaEngineReady = 50 - 8 = 42
824
+ // showInterstitialTime = 10 - 8 = 2
800
825
  cdl.saveTimestamp({key: 'client.lobby.entered', value: 20});
801
826
  cdl.saveTimestamp({key: 'client.lobby.exited', value: 30});
802
827
  // stayLobbyTimeCappedByMediaEngineReady = min(30, 50) - 20 = 10
803
- // total = 3 + 40 - 10 = 33
828
+ // total = 3 + 42 - 2 - 10 = 33
804
829
  assert.deepEqual(cdl.getTotalMediaJMT(), 33);
805
830
  });
806
831
 
807
832
  it('calculates getTotalMediaJMT correctly without lobby', () => {
808
833
  cdl.saveLatency('internal.click.to.interstitial', 3);
809
834
  // clickToInterstitial = 3
835
+ cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
810
836
  cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
811
837
  cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
812
- // interstitialClickJoinToMediaEngineReady = 40
838
+ // interstitialShowedToMediaEngineReady = 50 - 8 = 42
839
+ // showInterstitialTime = 10 - 8 = 2
813
840
  // no client.lobby.entered → stayLobbyTimeCappedByMediaEngineReady = 0
814
- // total = 3 + 40 - 0 = 43
841
+ // total = 3 + 42 - 2 - 0 = 43
815
842
  assert.deepEqual(cdl.getTotalMediaJMT(), 43);
816
843
  });
817
844
 
818
845
  it('calculates getTotalMediaJMT correctly with lobby exiting after media-engine.ready', () => {
819
846
  cdl.saveLatency('internal.click.to.interstitial', 3);
820
847
  // clickToInterstitial = 3
848
+ cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
821
849
  cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
822
850
  cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
823
- // interstitialClickJoinToMediaEngineReady = 40
851
+ // interstitialShowedToMediaEngineReady = 50 - 8 = 42
852
+ // showInterstitialTime = 10 - 8 = 2
824
853
  cdl.saveTimestamp({key: 'client.lobby.entered', value: 20});
825
854
  cdl.saveTimestamp({key: 'client.lobby.exited', value: 60});
826
855
  // stayLobbyTimeCappedByMediaEngineReady = min(60, 50) - 20 = 30
827
- // total = 3 + 40 - 30 = 13
856
+ // total = 3 + 42 - 2 - 30 = 13
828
857
  assert.deepEqual(cdl.getTotalMediaJMT(), 13);
829
858
  });
830
859
 
831
860
  it('calculates getTotalMediaJMT correctly when it is greater than MAX_INTEGER', () => {
832
- cdl.saveLatency('internal.click.to.interstitial', 3);
861
+ cdl.saveLatency('internal.click.to.interstitial', 5);
862
+ cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 10});
833
863
  cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
834
864
  cdl.saveTimestamp({key: 'client.media-engine.ready', value: 4294967400});
835
865
  cdl.saveTimestamp({key: 'client.lobby.entered', value: 28});
@@ -839,6 +869,7 @@ describe('internal-plugin-metrics', () => {
839
869
 
840
870
  it('returns undefined for getTotalMediaJMT when media-engine.ready is missing', () => {
841
871
  cdl.saveLatency('internal.click.to.interstitial', 3);
872
+ cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
842
873
  cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
843
874
  cdl.saveTimestamp({key: 'client.locus.join.response', value: 20});
844
875
  assert.deepEqual(cdl.getTotalMediaJMT(), undefined);
@@ -847,11 +878,13 @@ describe('internal-plugin-metrics', () => {
847
878
  it('calculates getTotalMediaJMT correctly when there is no lobby and stayLobbyTime defaults to 0', () => {
848
879
  cdl.saveLatency('internal.click.to.interstitial', 3);
849
880
  // clickToInterstitial = 3
881
+ cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
850
882
  cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
851
883
  cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
852
- // interstitialClickJoinToMediaEngineReady = 50 - 10 = 40
884
+ // interstitialShowedToMediaEngineReady = 50 - 8 = 42
885
+ // showInterstitialTime = 10 - 8 = 2
853
886
  // no client.lobby.entered → stayLobbyTimeCappedByMediaEngineReady = 0
854
- // total = 3 + 40 - 0 = 43
887
+ // total = 3 + 42 - 2 - 0 = 43
855
888
  assert.deepEqual(cdl.getTotalMediaJMT(), 43);
856
889
  });
857
890
 
@@ -932,6 +965,10 @@ describe('internal-plugin-metrics', () => {
932
965
 
933
966
  it('calculates getClientJMT correctly', () => {
934
967
  cdl.saveLatency('internal.click.to.interstitial.for.client.jmt', 5);
968
+ cdl.saveTimestamp({
969
+ key: 'internal.client.meeting.interstitial-window.showed',
970
+ value: 1,
971
+ });
935
972
  cdl.saveTimestamp({
936
973
  key: 'internal.client.interstitial-window.click.joinbutton',
937
974
  value: 2,
@@ -940,11 +977,16 @@ describe('internal-plugin-metrics', () => {
940
977
  key: 'client.locus.join.request',
941
978
  value: 6,
942
979
  });
943
- // clickToInterstitialForClientJmt (5) + interstitialJoinToLocusJoinRequest (6 - 2 = 4) = 9
980
+ // showedToLocusJoinRequest = 6-1 = 5, showInterstitialTime = 2-1 = 1
981
+ // clickToInterstitialForClientJmt (5) + 5 - 1 = 9
944
982
  assert.deepEqual(cdl.getClientJMT(), 9);
945
983
  });
946
984
 
947
985
  it('returns undefined for getClientJMT when clickToInterstitialForClientJmt is missing', () => {
986
+ cdl.saveTimestamp({
987
+ key: 'internal.client.meeting.interstitial-window.showed',
988
+ value: 1,
989
+ });
948
990
  cdl.saveTimestamp({
949
991
  key: 'internal.client.interstitial-window.click.joinbutton',
950
992
  value: 2,
@@ -1010,6 +1052,10 @@ describe('internal-plugin-metrics', () => {
1010
1052
  });
1011
1053
 
1012
1054
  it('calculates getInterstitialToMediaOKJMT correctly', () => {
1055
+ cdl.saveTimestamp({
1056
+ key: 'internal.client.meeting.interstitial-window.showed',
1057
+ value: 2,
1058
+ });
1013
1059
  cdl.saveTimestamp({
1014
1060
  key: 'internal.client.interstitial-window.click.joinbutton',
1015
1061
  value: 4,
@@ -1026,10 +1072,17 @@ describe('internal-plugin-metrics', () => {
1026
1072
  key: 'client.ice.end',
1027
1073
  value: 14,
1028
1074
  });
1075
+ // showedToIceEnd = 14-2 = 12, showInterstitialTime = 4-2 = 2
1076
+ // stayLobbyTimeCappedByIceEnd = min(12,14)-10 = 2
1077
+ // result = 12 - 2 - 2 = 8
1029
1078
  assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 8);
1030
1079
  });
1031
1080
 
1032
1081
  it('calculates getInterstitialToMediaOKJMT correctly when it is greater than MAX_INTEGER', () => {
1082
+ cdl.saveTimestamp({
1083
+ key: 'internal.client.meeting.interstitial-window.showed',
1084
+ value: 4,
1085
+ });
1033
1086
  cdl.saveTimestamp({
1034
1087
  key: 'internal.client.interstitial-window.click.joinbutton',
1035
1088
  value: 4,
@@ -1050,6 +1103,10 @@ describe('internal-plugin-metrics', () => {
1050
1103
  });
1051
1104
 
1052
1105
  it('calculates getInterstitialToMediaOKJMT correctly without lobby', () => {
1106
+ cdl.saveTimestamp({
1107
+ key: 'internal.client.meeting.interstitial-window.showed',
1108
+ value: 2,
1109
+ });
1053
1110
  cdl.saveTimestamp({
1054
1111
  key: 'internal.client.interstitial-window.click.joinbutton',
1055
1112
  value: 4,
@@ -1058,12 +1115,17 @@ describe('internal-plugin-metrics', () => {
1058
1115
  key: 'client.ice.end',
1059
1116
  value: 14,
1060
1117
  });
1061
- // no client.lobby.entered stayLobbyTimeCappedByIceEnd = 0
1062
- // result = (14 - 4) - 0 = 10
1118
+ // showedToIceEnd = 14-2 = 12, showInterstitialTime = 4-2 = 2
1119
+ // stayLobbyTimeCappedByIceEnd = 0 (no lobby)
1120
+ // result = 12 - 2 - 0 = 10
1063
1121
  assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 10);
1064
1122
  });
1065
1123
 
1066
1124
  it('calculates getInterstitialToMediaOKJMT correctly when there is no lobby and stayLobbyTime defaults to 0', () => {
1125
+ cdl.saveTimestamp({
1126
+ key: 'internal.client.meeting.interstitial-window.showed',
1127
+ value: 2,
1128
+ });
1067
1129
  cdl.saveTimestamp({
1068
1130
  key: 'internal.client.interstitial-window.click.joinbutton',
1069
1131
  value: 4,
@@ -1072,8 +1134,9 @@ describe('internal-plugin-metrics', () => {
1072
1134
  key: 'client.ice.end',
1073
1135
  value: 14,
1074
1136
  });
1075
- // no client.lobby.entered stayLobbyTimeCappedByIceEnd = 0
1076
- // result = (14 - 4) - 0 = 10
1137
+ // showedToIceEnd = 14-2 = 12, showInterstitialTime = 4-2 = 2
1138
+ // stayLobbyTimeCappedByIceEnd = 0 (no lobby)
1139
+ // result = 12 - 2 - 0 = 10
1077
1140
  assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 10);
1078
1141
  });
1079
1142