@webex/internal-plugin-metrics 3.12.0-next.4 → 3.12.0-next.6
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.
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +34 -21
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +8 -0
- package/package.json +2 -2
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +73 -23
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +4 -1
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +132 -206
|
@@ -335,6 +335,27 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
|
|
|
335
335
|
return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.lobby.exited');
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
+
/**
|
|
339
|
+
* Stay lobby time capped by a certain timestamp.
|
|
340
|
+
* This is to handle the case where the target end timestamp could happen before the lobby is exited,
|
|
341
|
+
* for example media-engine.ready or client.ice.end
|
|
342
|
+
* @param endTimestampKey name of the target end event
|
|
343
|
+
* @returns - latency
|
|
344
|
+
*/
|
|
345
|
+
}, {
|
|
346
|
+
key: "getStayLobbyTimeCappedBy",
|
|
347
|
+
value: function getStayLobbyTimeCappedBy(endTimestampKey) {
|
|
348
|
+
var lobbyStartTimestamp = this.latencyTimestamps.get('client.locus.join.response'); // must exist
|
|
349
|
+
var lobbyEndTimestamp = this.latencyTimestamps.get('client.lobby.exited'); // might not exist
|
|
350
|
+
var maximumEndTimestamp = this.latencyTimestamps.get(endTimestampKey); // must exist
|
|
351
|
+
|
|
352
|
+
if (typeof lobbyStartTimestamp !== 'number' || typeof maximumEndTimestamp !== 'number') {
|
|
353
|
+
return undefined;
|
|
354
|
+
}
|
|
355
|
+
var endTimestamp = typeof lobbyEndTimestamp === 'number' ? Math.min(lobbyEndTimestamp, maximumEndTimestamp) : maximumEndTimestamp;
|
|
356
|
+
return (0, _lodash.clamp)(endTimestamp - lobbyStartTimestamp, 0, this.MAX_INTEGER);
|
|
357
|
+
}
|
|
358
|
+
|
|
338
359
|
/**
|
|
339
360
|
* Page JMT
|
|
340
361
|
* @returns - latency
|
|
@@ -443,9 +464,9 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
|
|
|
443
464
|
key: "getTotalJMT",
|
|
444
465
|
value: function getTotalJMT() {
|
|
445
466
|
var clickToInterstitial = this.getClickToInterstitial();
|
|
446
|
-
var
|
|
447
|
-
if (typeof clickToInterstitial === 'number' && typeof
|
|
448
|
-
return (0, _lodash.clamp)(clickToInterstitial +
|
|
467
|
+
var interstitialClickJoinToJoinLocusResponse = this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.response');
|
|
468
|
+
if (typeof clickToInterstitial === 'number' && typeof interstitialClickJoinToJoinLocusResponse === 'number') {
|
|
469
|
+
return (0, _lodash.clamp)(clickToInterstitial + interstitialClickJoinToJoinLocusResponse, 0, this.MAX_INTEGER);
|
|
449
470
|
}
|
|
450
471
|
return undefined;
|
|
451
472
|
}
|
|
@@ -458,9 +479,9 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
|
|
|
458
479
|
key: "getTotalJMTWithUserDelay",
|
|
459
480
|
value: function getTotalJMTWithUserDelay() {
|
|
460
481
|
var clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
|
|
461
|
-
var
|
|
462
|
-
if (typeof clickToInterstitialWithUserDelay === 'number' && typeof
|
|
463
|
-
return (0, _lodash.clamp)(clickToInterstitialWithUserDelay +
|
|
482
|
+
var interstitialShowedToJoinLocusResponse = this.getDiffBetweenTimestamps('internal.client.meeting.interstitial-window.showed', 'client.locus.join.response');
|
|
483
|
+
if (typeof clickToInterstitialWithUserDelay === 'number' && typeof interstitialShowedToJoinLocusResponse === 'number') {
|
|
484
|
+
return (0, _lodash.clamp)(clickToInterstitialWithUserDelay + interstitialShowedToJoinLocusResponse, 0, this.MAX_INTEGER);
|
|
464
485
|
}
|
|
465
486
|
return undefined;
|
|
466
487
|
}
|
|
@@ -488,17 +509,10 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
|
|
|
488
509
|
key: "getTotalMediaJMT",
|
|
489
510
|
value: function getTotalMediaJMT() {
|
|
490
511
|
var clickToInterstitial = this.getClickToInterstitial();
|
|
491
|
-
var
|
|
492
|
-
var
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {
|
|
496
|
-
var _this$getMeeting;
|
|
497
|
-
var totalMediaJMT = (0, _lodash.clamp)(clickToInterstitial + interstitialToJoinOk + joinConfJMT, 0, Infinity);
|
|
498
|
-
if ((_this$getMeeting = this.getMeeting()) !== null && _this$getMeeting !== void 0 && _this$getMeeting.allowMediaInLobby) {
|
|
499
|
-
return (0, _lodash.clamp)(totalMediaJMT, 0, this.MAX_INTEGER);
|
|
500
|
-
}
|
|
501
|
-
return (0, _lodash.clamp)(totalMediaJMT - lobbyTime, 0, this.MAX_INTEGER);
|
|
512
|
+
var interstitialClickJoinToMediaEngineReady = this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.media-engine.ready');
|
|
513
|
+
var stayLobbyTimeCappedByMediaEngineReady = this.getStayLobbyTimeCappedBy('client.media-engine.ready');
|
|
514
|
+
if (typeof clickToInterstitial === 'number' && typeof interstitialClickJoinToMediaEngineReady === 'number' && typeof stayLobbyTimeCappedByMediaEngineReady === 'number') {
|
|
515
|
+
return (0, _lodash.clamp)(clickToInterstitial + interstitialClickJoinToMediaEngineReady - stayLobbyTimeCappedByMediaEngineReady, 0, this.MAX_INTEGER);
|
|
502
516
|
}
|
|
503
517
|
return undefined;
|
|
504
518
|
}
|
|
@@ -511,10 +525,9 @@ var CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlu
|
|
|
511
525
|
key: "getTotalMediaJMTWithUserDelay",
|
|
512
526
|
value: function getTotalMediaJMTWithUserDelay() {
|
|
513
527
|
var clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
|
|
514
|
-
var
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
return (0, _lodash.clamp)(clickToInterstitialWithUserDelay + interstitialToJoinOk + joinConfJMT, 0, this.MAX_INTEGER);
|
|
528
|
+
var interstitialShowedToMediaEngineReady = this.getDiffBetweenTimestamps('internal.client.meeting.interstitial-window.showed', 'client.media-engine.ready');
|
|
529
|
+
if (typeof clickToInterstitialWithUserDelay === 'number' && typeof interstitialShowedToMediaEngineReady === 'number') {
|
|
530
|
+
return (0, _lodash.clamp)(clickToInterstitialWithUserDelay + interstitialShowedToMediaEngineReady, 0, this.MAX_INTEGER);
|
|
518
531
|
}
|
|
519
532
|
return undefined;
|
|
520
533
|
}
|
|
@@ -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","getPageJMT","latency","getDownloadTimeJMT","getClickToInterstitial","clickToInterstitialLatency","getClickToInterstitialWithUserDelay","clickToInterstitialWithUserDelayLatency","getInterstitialToJoinOK","getCallInitMediaEngineReady","getInterstitialToMediaOKJMT","interstitialJoinClickTimestamp","connectedMedia","lobbyTimeLatency","lobbyTime","interstitialToMediaOKJmt","getTotalJMT","clickToInterstitial","interstitialToJoinOk","getTotalJMTWithUserDelay","clickToInterstitialWithUserDelay","getJoinConfJMT","joinReqResp","ICESetupTime","getTotalMediaJMT","joinConfJMT","_this$getMeeting","totalMediaJMT","Infinity","allowMediaInLobby","getTotalMediaJMTWithUserDelay","getClientJMT","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.locus.join.response', 'client.lobby.exited');\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 // 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 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 // 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 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.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.media-engine.ready',\n {maximum: 1200000}\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 lobbyTimeLatency = this.getStayLobbyTime();\n const lobbyTime = typeof lobbyTimeLatency === 'number' ? lobbyTimeLatency : 0;\n\n if (interstitialJoinClickTimestamp && connectedMedia) {\n const interstitialToMediaOKJmt = connectedMedia - interstitialJoinClickTimestamp - lobbyTime;\n\n return clamp(interstitialToMediaOKJmt, 0, this.MAX_INTEGER);\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 (typeof clickToInterstitial === 'number' && typeof interstitialToJoinOk === 'number') {\n return clamp(clickToInterstitial + interstitialToJoinOk, 0, this.MAX_INTEGER);\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 interstitialToJoinOk = this.getInterstitialToJoinOK();\n\n if (\n typeof clickToInterstitialWithUserDelay === 'number' &&\n typeof interstitialToJoinOk === 'number'\n ) {\n return clamp(clickToInterstitialWithUserDelay + interstitialToJoinOk, 0, this.MAX_INTEGER);\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 interstitialToJoinOk = this.getInterstitialToJoinOK();\n const joinConfJMT = this.getJoinConfJMT();\n const lobbyTimeLatency = this.getStayLobbyTime();\n const lobbyTime = typeof lobbyTimeLatency === 'number' ? lobbyTimeLatency : 0;\n\n if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {\n const totalMediaJMT = clamp(\n clickToInterstitial + interstitialToJoinOk + joinConfJMT,\n 0,\n Infinity\n );\n if (this.getMeeting()?.allowMediaInLobby) {\n return clamp(totalMediaJMT, 0, this.MAX_INTEGER);\n }\n\n return clamp(totalMediaJMT - lobbyTime, 0, this.MAX_INTEGER);\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 interstitialToJoinOk = this.getInterstitialToJoinOK();\n const joinConfJMT = this.getJoinConfJMT();\n\n if (clickToInterstitialWithUserDelay && interstitialToJoinOk && joinConfJMT) {\n return clamp(\n clickToInterstitialWithUserDelay + interstitialToJoinOk + joinConfJMT,\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 interstitialToJoinOk = this.getInterstitialToJoinOK();\n const joinConfJMT = this.getJoinConfJMT();\n\n if (typeof interstitialToJoinOk === 'number' && typeof joinConfJMT === 'number') {\n return clamp(interstitialToJoinOk - joinConfJMT, 0, this.MAX_INTEGER);\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.precom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AAAA,EArmBkDkG,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","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","interstitialJoinClickTimestamp","connectedMedia","lobbyTimeLatency","lobbyTime","interstitialToMediaOKJmt","getTotalJMT","clickToInterstitial","interstitialClickJoinToJoinLocusResponse","getTotalJMTWithUserDelay","clickToInterstitialWithUserDelay","interstitialShowedToJoinLocusResponse","getJoinConfJMT","joinReqResp","ICESetupTime","getTotalMediaJMT","interstitialClickJoinToMediaEngineReady","stayLobbyTimeCappedByMediaEngineReady","getTotalMediaJMTWithUserDelay","interstitialShowedToMediaEngineReady","getClientJMT","interstitialToJoinOk","joinConfJMT","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.locus.join.response', '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 * @param endTimestampKey name of the target end event\n * @returns - latency\n */\n public getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames) {\n const lobbyStartTimestamp = this.latencyTimestamps.get('client.locus.join.response'); // must exist\n const lobbyEndTimestamp = this.latencyTimestamps.get('client.lobby.exited'); // might not exist\n const maximumEndTimestamp = this.latencyTimestamps.get(endTimestampKey); // must exist\n\n if (typeof lobbyStartTimestamp !== 'number' || typeof maximumEndTimestamp !== 'number') {\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 // 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 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 // 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 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.getDiffBetweenTimestamps(\n 'internal.client.interstitial-window.click.joinbutton',\n 'client.media-engine.ready',\n {maximum: 1200000}\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 lobbyTimeLatency = this.getStayLobbyTime();\n const lobbyTime = typeof lobbyTimeLatency === 'number' ? lobbyTimeLatency : 0;\n\n if (interstitialJoinClickTimestamp && connectedMedia) {\n const interstitialToMediaOKJmt = connectedMedia - interstitialJoinClickTimestamp - lobbyTime;\n\n return clamp(interstitialToMediaOKJmt, 0, this.MAX_INTEGER);\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 interstitialToJoinOk = this.getInterstitialToJoinOK();\n const joinConfJMT = this.getJoinConfJMT();\n\n if (typeof interstitialToJoinOk === 'number' && typeof joinConfJMT === 'number') {\n return clamp(interstitialToJoinOk - joinConfJMT, 0, this.MAX_INTEGER);\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,IAKqBc,uBAAuB,GAAAC,OAAA,CAAAX,OAAA,0BAAAY,YAAA;EAO1C;AACF;AACA;EACE,SAAAF,wBAAA,EAAqB;IAAA,IAAAG,KAAA;IAAA,IAAAC,gBAAA,CAAAd,OAAA,QAAAU,uBA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E,WAAW,CAAC,GAC7DlC,SAAS;IACf;;IAEA;AACF;AACA;AACA;EAHE;IAAAV,GAAA;IAAAC,KAAA,EAIA,SAAO+G,oCAAoCA,CAAA,EAAG;MAC5C,IAAMC,iCAAiC,GAAG,IAAI,CAACpH,oBAAoB,CAAC2B,GAAG,CACrE,wCACF,CAAC;MAED,OAAO,OAAOyF,iCAAiC,KAAK,QAAQ,GACxD,IAAApE,aAAK,EAACK,IAAI,CAACC,KAAK,CAAC8D,iCAAiC,CAAC,EAAE,CAAC,EAAE,IAAI,CAACrE,WAAW,CAAC,GACzElC,SAAS;IACf;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAAV,GAAA;IAAAC,KAAA,EAKA,SAAOiH,qBAAqBA,CAAA,EAAG;MAC7B,IAAMC,cAAc,GAAG,IAAI,CAACtH,oBAAoB,CAAC2B,GAAG,CAAC,6BAA6B,CAAC;MAEnF,OAAO2F,cAAc,GAAG,CAAC,GAAG,IAAAtE,aAAK,EAACK,IAAI,CAACC,KAAK,CAACgE,cAAc,CAAC,EAAE,CAAC,EAAE,IAAI,CAACvE,WAAW,CAAC,GAAGlC,SAAS;IAChG;EAAC;AAAA,EAvpBkD0G,sBAAW","ignoreList":[]}
|
package/dist/metrics.js
CHANGED
|
@@ -149,6 +149,14 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
149
149
|
* @returns - latency
|
|
150
150
|
*/
|
|
151
151
|
getStayLobbyTime(): number;
|
|
152
|
+
/**
|
|
153
|
+
* Stay lobby time capped by a certain timestamp.
|
|
154
|
+
* This is to handle the case where the target end timestamp could happen before the lobby is exited,
|
|
155
|
+
* for example media-engine.ready or client.ice.end
|
|
156
|
+
* @param endTimestampKey name of the target end event
|
|
157
|
+
* @returns - latency
|
|
158
|
+
*/
|
|
159
|
+
getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames): number;
|
|
152
160
|
/**
|
|
153
161
|
* Page JMT
|
|
154
162
|
* @returns - latency
|
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.
|
|
43
|
+
"@webex/webex-core": "3.12.0-next.6",
|
|
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.
|
|
56
|
+
"version": "3.12.0-next.6"
|
|
57
57
|
}
|
|
@@ -306,6 +306,30 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
306
306
|
return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.lobby.exited');
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
+
/**
|
|
310
|
+
* Stay lobby time capped by a certain timestamp.
|
|
311
|
+
* This is to handle the case where the target end timestamp could happen before the lobby is exited,
|
|
312
|
+
* for example media-engine.ready or client.ice.end
|
|
313
|
+
* @param endTimestampKey name of the target end event
|
|
314
|
+
* @returns - latency
|
|
315
|
+
*/
|
|
316
|
+
public getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames) {
|
|
317
|
+
const lobbyStartTimestamp = this.latencyTimestamps.get('client.locus.join.response'); // must exist
|
|
318
|
+
const lobbyEndTimestamp = this.latencyTimestamps.get('client.lobby.exited'); // might not exist
|
|
319
|
+
const maximumEndTimestamp = this.latencyTimestamps.get(endTimestampKey); // must exist
|
|
320
|
+
|
|
321
|
+
if (typeof lobbyStartTimestamp !== 'number' || typeof maximumEndTimestamp !== 'number') {
|
|
322
|
+
return undefined;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const endTimestamp =
|
|
326
|
+
typeof lobbyEndTimestamp === 'number'
|
|
327
|
+
? Math.min(lobbyEndTimestamp, maximumEndTimestamp)
|
|
328
|
+
: maximumEndTimestamp;
|
|
329
|
+
|
|
330
|
+
return clamp(endTimestamp - lobbyStartTimestamp, 0, this.MAX_INTEGER);
|
|
331
|
+
}
|
|
332
|
+
|
|
309
333
|
/**
|
|
310
334
|
* Page JMT
|
|
311
335
|
* @returns - latency
|
|
@@ -427,10 +451,20 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
427
451
|
*/
|
|
428
452
|
public getTotalJMT() {
|
|
429
453
|
const clickToInterstitial = this.getClickToInterstitial();
|
|
430
|
-
const
|
|
454
|
+
const interstitialClickJoinToJoinLocusResponse = this.getDiffBetweenTimestamps(
|
|
455
|
+
'internal.client.interstitial-window.click.joinbutton',
|
|
456
|
+
'client.locus.join.response'
|
|
457
|
+
);
|
|
431
458
|
|
|
432
|
-
if (
|
|
433
|
-
|
|
459
|
+
if (
|
|
460
|
+
typeof clickToInterstitial === 'number' &&
|
|
461
|
+
typeof interstitialClickJoinToJoinLocusResponse === 'number'
|
|
462
|
+
) {
|
|
463
|
+
return clamp(
|
|
464
|
+
clickToInterstitial + interstitialClickJoinToJoinLocusResponse,
|
|
465
|
+
0,
|
|
466
|
+
this.MAX_INTEGER
|
|
467
|
+
);
|
|
434
468
|
}
|
|
435
469
|
|
|
436
470
|
return undefined;
|
|
@@ -442,13 +476,20 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
442
476
|
*/
|
|
443
477
|
public getTotalJMTWithUserDelay() {
|
|
444
478
|
const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
|
|
445
|
-
const
|
|
479
|
+
const interstitialShowedToJoinLocusResponse = this.getDiffBetweenTimestamps(
|
|
480
|
+
'internal.client.meeting.interstitial-window.showed',
|
|
481
|
+
'client.locus.join.response'
|
|
482
|
+
);
|
|
446
483
|
|
|
447
484
|
if (
|
|
448
485
|
typeof clickToInterstitialWithUserDelay === 'number' &&
|
|
449
|
-
typeof
|
|
486
|
+
typeof interstitialShowedToJoinLocusResponse === 'number'
|
|
450
487
|
) {
|
|
451
|
-
return clamp(
|
|
488
|
+
return clamp(
|
|
489
|
+
clickToInterstitialWithUserDelay + interstitialShowedToJoinLocusResponse,
|
|
490
|
+
0,
|
|
491
|
+
this.MAX_INTEGER
|
|
492
|
+
);
|
|
452
493
|
}
|
|
453
494
|
|
|
454
495
|
return undefined;
|
|
@@ -475,22 +516,26 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
475
516
|
*/
|
|
476
517
|
public getTotalMediaJMT() {
|
|
477
518
|
const clickToInterstitial = this.getClickToInterstitial();
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
519
|
+
const interstitialClickJoinToMediaEngineReady = this.getDiffBetweenTimestamps(
|
|
520
|
+
'internal.client.interstitial-window.click.joinbutton',
|
|
521
|
+
'client.media-engine.ready'
|
|
522
|
+
);
|
|
523
|
+
const stayLobbyTimeCappedByMediaEngineReady = this.getStayLobbyTimeCappedBy(
|
|
524
|
+
'client.media-engine.ready'
|
|
525
|
+
);
|
|
482
526
|
|
|
483
|
-
if (
|
|
484
|
-
|
|
485
|
-
|
|
527
|
+
if (
|
|
528
|
+
typeof clickToInterstitial === 'number' &&
|
|
529
|
+
typeof interstitialClickJoinToMediaEngineReady === 'number' &&
|
|
530
|
+
typeof stayLobbyTimeCappedByMediaEngineReady === 'number'
|
|
531
|
+
) {
|
|
532
|
+
return clamp(
|
|
533
|
+
clickToInterstitial +
|
|
534
|
+
interstitialClickJoinToMediaEngineReady -
|
|
535
|
+
stayLobbyTimeCappedByMediaEngineReady,
|
|
486
536
|
0,
|
|
487
|
-
|
|
537
|
+
this.MAX_INTEGER
|
|
488
538
|
);
|
|
489
|
-
if (this.getMeeting()?.allowMediaInLobby) {
|
|
490
|
-
return clamp(totalMediaJMT, 0, this.MAX_INTEGER);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
return clamp(totalMediaJMT - lobbyTime, 0, this.MAX_INTEGER);
|
|
494
539
|
}
|
|
495
540
|
|
|
496
541
|
return undefined;
|
|
@@ -502,12 +547,17 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
502
547
|
*/
|
|
503
548
|
public getTotalMediaJMTWithUserDelay() {
|
|
504
549
|
const clickToInterstitialWithUserDelay = this.getClickToInterstitialWithUserDelay();
|
|
505
|
-
const
|
|
506
|
-
|
|
550
|
+
const interstitialShowedToMediaEngineReady = this.getDiffBetweenTimestamps(
|
|
551
|
+
'internal.client.meeting.interstitial-window.showed',
|
|
552
|
+
'client.media-engine.ready'
|
|
553
|
+
);
|
|
507
554
|
|
|
508
|
-
if (
|
|
555
|
+
if (
|
|
556
|
+
typeof clickToInterstitialWithUserDelay === 'number' &&
|
|
557
|
+
typeof interstitialShowedToMediaEngineReady === 'number'
|
|
558
|
+
) {
|
|
509
559
|
return clamp(
|
|
510
|
-
clickToInterstitialWithUserDelay +
|
|
560
|
+
clickToInterstitialWithUserDelay + interstitialShowedToMediaEngineReady,
|
|
511
561
|
0,
|
|
512
562
|
this.MAX_INTEGER
|
|
513
563
|
);
|
|
@@ -346,6 +346,9 @@ describe('plugin-metrics', () => {
|
|
|
346
346
|
webex.internal.newMetrics.callDiagnosticLatencies.getStayLobbyTime = sinon
|
|
347
347
|
.stub()
|
|
348
348
|
.returns(1);
|
|
349
|
+
webex.internal.newMetrics.callDiagnosticLatencies.getStayLobbyTimeCappedBy = sinon
|
|
350
|
+
.stub()
|
|
351
|
+
.returns(1);
|
|
349
352
|
webex.internal.newMetrics.callDiagnosticLatencies.getTotalMediaJMTWithUserDelay = sinon
|
|
350
353
|
.stub()
|
|
351
354
|
.returns(43);
|
|
@@ -366,7 +369,7 @@ describe('plugin-metrics', () => {
|
|
|
366
369
|
assert.deepEqual(webex.request.getCalls()[0].args[0].body.metrics[0].eventPayload.event, {
|
|
367
370
|
name: 'client.media-engine.ready',
|
|
368
371
|
joinTimes: {
|
|
369
|
-
totalMediaJMT:
|
|
372
|
+
totalMediaJMT: 44,
|
|
370
373
|
interstitialToMediaOKJMT: 22,
|
|
371
374
|
callInitMediaEngineReady: 10,
|
|
372
375
|
totalMediaJMTWithUserDelay: 43,
|
|
@@ -519,6 +519,50 @@ describe('internal-plugin-metrics', () => {
|
|
|
519
519
|
assert.deepEqual(cdl.getStayLobbyTime(), 10);
|
|
520
520
|
});
|
|
521
521
|
|
|
522
|
+
describe('getStayLobbyTimeCappedBy', () => {
|
|
523
|
+
it('returns undefined when lobbyStartTimestamp is missing', () => {
|
|
524
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 100});
|
|
525
|
+
assert.deepEqual(cdl.getStayLobbyTimeCappedBy('client.media-engine.ready'), undefined);
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
it('returns undefined when endTimestampKey is missing', () => {
|
|
529
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 10});
|
|
530
|
+
assert.deepEqual(cdl.getStayLobbyTimeCappedBy('client.media-engine.ready'), undefined);
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
it('uses maximumEndTimestamp when lobby end does not exist', () => {
|
|
534
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 10});
|
|
535
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
536
|
+
assert.deepEqual(cdl.getStayLobbyTimeCappedBy('client.media-engine.ready'), 40);
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
it('uses lobby end when it is before maximumEndTimestamp', () => {
|
|
540
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 10});
|
|
541
|
+
cdl.saveTimestamp({key: 'client.lobby.exited', value: 30});
|
|
542
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
543
|
+
assert.deepEqual(cdl.getStayLobbyTimeCappedBy('client.media-engine.ready'), 20);
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
it('uses maximumEndTimestamp when lobby end is after it', () => {
|
|
547
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 10});
|
|
548
|
+
cdl.saveTimestamp({key: 'client.lobby.exited', value: 60});
|
|
549
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
550
|
+
assert.deepEqual(cdl.getStayLobbyTimeCappedBy('client.media-engine.ready'), 40);
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
it('clamps to 0 when result would be negative', () => {
|
|
554
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 100});
|
|
555
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
556
|
+
assert.deepEqual(cdl.getStayLobbyTimeCappedBy('client.media-engine.ready'), 0);
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
it('clamps to MAX_INTEGER when result is very large', () => {
|
|
560
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 0});
|
|
561
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 2147483648});
|
|
562
|
+
assert.deepEqual(cdl.getStayLobbyTimeCappedBy('client.media-engine.ready'), 2147483647);
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
|
|
522
566
|
it('calculates getPageJMT correctly', () => {
|
|
523
567
|
cdl.saveLatency('internal.client.pageJMT', 10);
|
|
524
568
|
assert.deepEqual(cdl.getPageJMT(), 10);
|
|
@@ -668,7 +712,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
668
712
|
assert.deepEqual(cdl.getTotalJMT(), 20);
|
|
669
713
|
});
|
|
670
714
|
|
|
671
|
-
it('calculates getTotalJMT correctly when
|
|
715
|
+
it('calculates getTotalJMT correctly when interstitialClickJoinToJoinLocusResponse is 0', () => {
|
|
672
716
|
cdl.saveTimestamp({
|
|
673
717
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
674
718
|
value: 40,
|
|
@@ -681,7 +725,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
681
725
|
assert.deepEqual(cdl.getTotalJMT(), 12);
|
|
682
726
|
});
|
|
683
727
|
|
|
684
|
-
it('calculates getTotalJMT correctly when both clickToInterstitial and
|
|
728
|
+
it('calculates getTotalJMT correctly when both clickToInterstitial and interstitialClickJoinToJoinLocusResponse are 0', () => {
|
|
685
729
|
cdl.saveTimestamp({
|
|
686
730
|
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
687
731
|
value: 40,
|
|
@@ -737,13 +781,13 @@ describe('internal-plugin-metrics', () => {
|
|
|
737
781
|
key: 'client.locus.join.response',
|
|
738
782
|
value: 40,
|
|
739
783
|
});
|
|
740
|
-
assert.deepEqual(cdl.getTotalJMTWithUserDelay(),
|
|
784
|
+
assert.deepEqual(cdl.getTotalJMTWithUserDelay(), 30);
|
|
741
785
|
});
|
|
742
786
|
|
|
743
787
|
it('calculates getTotalJMTWithUserDelay correctly when clickToInterstitialWithUserDelay is 0', () => {
|
|
744
788
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 0);
|
|
745
789
|
cdl.saveTimestamp({
|
|
746
|
-
key: 'internal.client.interstitial-window.
|
|
790
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
747
791
|
value: 20,
|
|
748
792
|
});
|
|
749
793
|
cdl.saveTimestamp({
|
|
@@ -753,9 +797,9 @@ describe('internal-plugin-metrics', () => {
|
|
|
753
797
|
assert.deepEqual(cdl.getTotalJMTWithUserDelay(), 20);
|
|
754
798
|
});
|
|
755
799
|
|
|
756
|
-
it('calculates getTotalJMTWithUserDelay correctly when
|
|
800
|
+
it('calculates getTotalJMTWithUserDelay correctly when interstitialShowedToJoinLocusResponse is 0', () => {
|
|
757
801
|
cdl.saveTimestamp({
|
|
758
|
-
key: 'internal.client.interstitial-window.
|
|
802
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
759
803
|
value: 40,
|
|
760
804
|
});
|
|
761
805
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 12);
|
|
@@ -766,9 +810,9 @@ describe('internal-plugin-metrics', () => {
|
|
|
766
810
|
assert.deepEqual(cdl.getTotalJMTWithUserDelay(), 12);
|
|
767
811
|
});
|
|
768
812
|
|
|
769
|
-
it('calculates getTotalJMTWithUserDelay correctly when both clickToInterstitialWithUserDelay and
|
|
813
|
+
it('calculates getTotalJMTWithUserDelay correctly when both clickToInterstitialWithUserDelay and interstitialShowedToJoinLocusResponse are 0', () => {
|
|
770
814
|
cdl.saveTimestamp({
|
|
771
|
-
key: 'internal.client.interstitial-window.
|
|
815
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
772
816
|
value: 40,
|
|
773
817
|
});
|
|
774
818
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 0);
|
|
@@ -781,7 +825,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
781
825
|
|
|
782
826
|
it('calculates getTotalJMTWithUserDelay correctly when both clickToInterstitialWithUserDelay is not a number', () => {
|
|
783
827
|
cdl.saveTimestamp({
|
|
784
|
-
key: 'internal.client.interstitial-window.
|
|
828
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
785
829
|
value: 40,
|
|
786
830
|
});
|
|
787
831
|
cdl.saveLatency(
|
|
@@ -798,7 +842,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
798
842
|
it('calculates getTotalJMTWithUserDelay correctly when it is greater than MAX_INTEGER', () => {
|
|
799
843
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 2147483648);
|
|
800
844
|
cdl.saveTimestamp({
|
|
801
|
-
key: 'internal.client.interstitial-window.
|
|
845
|
+
key: 'internal.client.meeting.interstitial-window.showed',
|
|
802
846
|
value: 20,
|
|
803
847
|
});
|
|
804
848
|
cdl.saveTimestamp({
|
|
@@ -808,215 +852,97 @@ describe('internal-plugin-metrics', () => {
|
|
|
808
852
|
assert.deepEqual(cdl.getTotalJMTWithUserDelay(), 2147483647);
|
|
809
853
|
});
|
|
810
854
|
|
|
811
|
-
it('calculates getTotalMediaJMT correctly', () => {
|
|
812
|
-
cdl.saveTimestamp({
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
});
|
|
816
|
-
cdl.saveTimestamp({
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
});
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
});
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
cdl.saveTimestamp({
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
cdl.
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
cdl.saveTimestamp({
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
});
|
|
844
|
-
|
|
855
|
+
it('calculates getTotalMediaJMT correctly with lobby exiting before media-engine.ready', () => {
|
|
856
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.click.joinbutton', value: 5});
|
|
857
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
858
|
+
// clickToInterstitial = 8 - 5 = 3
|
|
859
|
+
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
860
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
861
|
+
// interstitialClickJoinToMediaEngineReady = 50 - 10 = 40
|
|
862
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 20});
|
|
863
|
+
cdl.saveTimestamp({key: 'client.lobby.exited', value: 30});
|
|
864
|
+
// stayLobbyTimeCappedByMediaEngineReady = min(30, 50) - 20 = 10
|
|
865
|
+
// total = 3 + 40 - 10 = 33
|
|
866
|
+
assert.deepEqual(cdl.getTotalMediaJMT(), 33);
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
it('calculates getTotalMediaJMT correctly without lobby', () => {
|
|
870
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.click.joinbutton', value: 5});
|
|
871
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
872
|
+
// clickToInterstitial = 3
|
|
873
|
+
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
874
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
875
|
+
// interstitialClickJoinToMediaEngineReady = 40
|
|
876
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 20});
|
|
877
|
+
// no client.lobby.exited
|
|
878
|
+
// stayLobbyTimeCappedByMediaEngineReady = 50 - 20 = 30
|
|
879
|
+
// total = 3 + 40 - 30 = 13
|
|
880
|
+
assert.deepEqual(cdl.getTotalMediaJMT(), 13);
|
|
881
|
+
});
|
|
882
|
+
|
|
883
|
+
it('calculates getTotalMediaJMT correctly with lobby exiting after media-engine.ready', () => {
|
|
884
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.click.joinbutton', value: 5});
|
|
885
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
886
|
+
// clickToInterstitial = 3
|
|
887
|
+
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
888
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
889
|
+
// interstitialClickJoinToMediaEngineReady = 40
|
|
890
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 20});
|
|
891
|
+
cdl.saveTimestamp({key: 'client.lobby.exited', value: 60});
|
|
892
|
+
// stayLobbyTimeCappedByMediaEngineReady = min(60, 50) - 20 = 30
|
|
893
|
+
// total = 3 + 40 - 30 = 13
|
|
894
|
+
assert.deepEqual(cdl.getTotalMediaJMT(), 13);
|
|
845
895
|
});
|
|
846
896
|
|
|
847
897
|
it('calculates getTotalMediaJMT correctly when it is greater than MAX_INTEGER', () => {
|
|
848
|
-
cdl.saveTimestamp({
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
});
|
|
852
|
-
cdl.saveTimestamp({
|
|
853
|
-
|
|
854
|
-
value: 8,
|
|
855
|
-
});
|
|
856
|
-
cdl.saveTimestamp({
|
|
857
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
858
|
-
value: 10,
|
|
859
|
-
});
|
|
860
|
-
cdl.saveTimestamp({
|
|
861
|
-
key: 'client.locus.join.request',
|
|
862
|
-
value: 12,
|
|
863
|
-
});
|
|
864
|
-
cdl.saveTimestamp({
|
|
865
|
-
key: 'client.locus.join.response',
|
|
866
|
-
value: 2147483700,
|
|
867
|
-
});
|
|
868
|
-
cdl.saveTimestamp({
|
|
869
|
-
key: 'client.lobby.exited',
|
|
870
|
-
value: 2147483800,
|
|
871
|
-
});
|
|
872
|
-
cdl.saveTimestamp({
|
|
873
|
-
key: 'client.ice.start',
|
|
874
|
-
value: 30,
|
|
875
|
-
});
|
|
876
|
-
cdl.saveTimestamp({
|
|
877
|
-
key: 'client.ice.end',
|
|
878
|
-
value: 100,
|
|
879
|
-
});
|
|
898
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.click.joinbutton', value: 5});
|
|
899
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
900
|
+
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
901
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 4294967400});
|
|
902
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 28});
|
|
903
|
+
cdl.saveTimestamp({key: 'client.lobby.exited', value: 30});
|
|
880
904
|
assert.deepEqual(cdl.getTotalMediaJMT(), 2147483647);
|
|
881
905
|
});
|
|
882
906
|
|
|
883
|
-
it('
|
|
884
|
-
cdl.saveTimestamp({
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
cdl.saveTimestamp({
|
|
890
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
891
|
-
value: 8,
|
|
892
|
-
});
|
|
893
|
-
cdl.saveTimestamp({
|
|
894
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
895
|
-
value: 10,
|
|
896
|
-
});
|
|
897
|
-
cdl.saveTimestamp({
|
|
898
|
-
key: 'client.locus.join.request',
|
|
899
|
-
value: 12,
|
|
900
|
-
});
|
|
901
|
-
cdl.saveTimestamp({
|
|
902
|
-
key: 'client.locus.join.response',
|
|
903
|
-
value: 20,
|
|
904
|
-
});
|
|
905
|
-
cdl.saveTimestamp({
|
|
906
|
-
key: 'client.lobby.exited',
|
|
907
|
-
value: 24,
|
|
908
|
-
});
|
|
909
|
-
cdl.saveTimestamp({
|
|
910
|
-
key: 'client.ice.start',
|
|
911
|
-
value: 30,
|
|
912
|
-
});
|
|
913
|
-
cdl.saveTimestamp({
|
|
914
|
-
key: 'client.ice.end',
|
|
915
|
-
value: 40,
|
|
916
|
-
});
|
|
917
|
-
assert.deepEqual(cdl.getTotalMediaJMT(), 31);
|
|
918
|
-
});
|
|
919
|
-
|
|
920
|
-
it('calculates getTotalMediaJMT correctly with allowMediaInLobby true and it is greater than MAX_INTEGER', () => {
|
|
921
|
-
cdl.saveTimestamp({
|
|
922
|
-
key: 'internal.client.meeting.click.joinbutton',
|
|
923
|
-
value: 5,
|
|
924
|
-
options: {meetingId: 'meeting-id'},
|
|
925
|
-
});
|
|
926
|
-
cdl.saveTimestamp({
|
|
927
|
-
key: 'internal.client.meeting.interstitial-window.showed',
|
|
928
|
-
value: 100,
|
|
929
|
-
});
|
|
930
|
-
cdl.saveTimestamp({
|
|
931
|
-
key: 'internal.client.interstitial-window.click.joinbutton',
|
|
932
|
-
value: 1000,
|
|
933
|
-
});
|
|
934
|
-
cdl.saveTimestamp({
|
|
935
|
-
key: 'client.locus.join.request',
|
|
936
|
-
value: 2000,
|
|
937
|
-
});
|
|
938
|
-
cdl.saveTimestamp({
|
|
939
|
-
key: 'client.locus.join.response',
|
|
940
|
-
value: 2147483700,
|
|
941
|
-
});
|
|
942
|
-
cdl.saveTimestamp({
|
|
943
|
-
key: 'client.lobby.exited',
|
|
944
|
-
value: 2147483800,
|
|
945
|
-
});
|
|
946
|
-
cdl.saveTimestamp({
|
|
947
|
-
key: 'client.ice.start',
|
|
948
|
-
value: 2147483900,
|
|
949
|
-
});
|
|
950
|
-
cdl.saveTimestamp({
|
|
951
|
-
key: 'client.ice.end',
|
|
952
|
-
value: 4294967400,
|
|
953
|
-
});
|
|
954
|
-
assert.deepEqual(cdl.getTotalMediaJMT(), 2147483647);
|
|
907
|
+
it('returns undefined for getTotalMediaJMT when media-engine.ready is missing', () => {
|
|
908
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.click.joinbutton', value: 5});
|
|
909
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
910
|
+
cdl.saveTimestamp({key: 'internal.client.interstitial-window.click.joinbutton', value: 10});
|
|
911
|
+
cdl.saveTimestamp({key: 'client.locus.join.response', value: 20});
|
|
912
|
+
assert.deepEqual(cdl.getTotalMediaJMT(), undefined);
|
|
955
913
|
});
|
|
956
914
|
|
|
957
915
|
it('calculates getTotalMediaJMTWithUserDelay correctly', () => {
|
|
958
916
|
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 7);
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
value: 12,
|
|
966
|
-
});
|
|
967
|
-
cdl.saveTimestamp({
|
|
968
|
-
key: 'client.locus.join.response',
|
|
969
|
-
value: 20,
|
|
970
|
-
});
|
|
971
|
-
cdl.saveTimestamp({
|
|
972
|
-
key: 'internal.host.meeting.participant.admitted',
|
|
973
|
-
value: 24,
|
|
974
|
-
});
|
|
975
|
-
cdl.saveTimestamp({
|
|
976
|
-
key: 'client.ice.start',
|
|
977
|
-
value: 30,
|
|
978
|
-
});
|
|
979
|
-
cdl.saveTimestamp({
|
|
980
|
-
key: 'client.ice.end',
|
|
981
|
-
value: 40,
|
|
982
|
-
});
|
|
983
|
-
assert.deepEqual(cdl.getTotalMediaJMTWithUserDelay(), 35);
|
|
917
|
+
// clickToInterstitialWithUserDelay = 7
|
|
918
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 10});
|
|
919
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
920
|
+
// interstitialShowedToMediaEngineReady = 50 - 10 = 40
|
|
921
|
+
// total = 7 + 40 = 47
|
|
922
|
+
assert.deepEqual(cdl.getTotalMediaJMTWithUserDelay(), 47);
|
|
984
923
|
});
|
|
985
924
|
|
|
986
925
|
it('calculates getTotalMediaJMTWithUserDelay correctly for guest join', () => {
|
|
987
|
-
cdl.saveTimestamp({
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
});
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
});
|
|
999
|
-
cdl.
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
cdl.
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
cdl.saveTimestamp({
|
|
1008
|
-
key: 'internal.host.meeting.participant.admitted',
|
|
1009
|
-
value: 24,
|
|
1010
|
-
});
|
|
1011
|
-
cdl.saveTimestamp({
|
|
1012
|
-
key: 'client.ice.start',
|
|
1013
|
-
value: 30,
|
|
1014
|
-
});
|
|
1015
|
-
cdl.saveTimestamp({
|
|
1016
|
-
key: 'client.ice.end',
|
|
1017
|
-
value: 40,
|
|
1018
|
-
});
|
|
1019
|
-
assert.deepEqual(cdl.getTotalMediaJMTWithUserDelay(), 31);
|
|
926
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.click.joinbutton', value: 5});
|
|
927
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 8});
|
|
928
|
+
// clickToInterstitialWithUserDelay = 8 - 5 = 3
|
|
929
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
930
|
+
// interstitialShowedToMediaEngineReady = 50 - 8 = 42
|
|
931
|
+
// total = 3 + 42 = 45
|
|
932
|
+
assert.deepEqual(cdl.getTotalMediaJMTWithUserDelay(), 45);
|
|
933
|
+
});
|
|
934
|
+
|
|
935
|
+
it('returns undefined for getTotalMediaJMTWithUserDelay when media-engine.ready is missing', () => {
|
|
936
|
+
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 7);
|
|
937
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 10});
|
|
938
|
+
assert.deepEqual(cdl.getTotalMediaJMTWithUserDelay(), undefined);
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
it('calculates getTotalMediaJMTWithUserDelay correctly when it is greater than MAX_INTEGER', () => {
|
|
942
|
+
cdl.saveLatency('internal.click.to.interstitial.with.user.delay', 2147483648);
|
|
943
|
+
cdl.saveTimestamp({key: 'internal.client.meeting.interstitial-window.showed', value: 10});
|
|
944
|
+
cdl.saveTimestamp({key: 'client.media-engine.ready', value: 50});
|
|
945
|
+
assert.deepEqual(cdl.getTotalMediaJMTWithUserDelay(), 2147483647);
|
|
1020
946
|
});
|
|
1021
947
|
|
|
1022
948
|
it('calculates getJoinConfJMT correctly', () => {
|