@atlaskit/react-ufo 4.4.5 → 4.4.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/CHANGELOG.md +7 -0
- package/dist/cjs/config/index.js +42 -36
- package/dist/cjs/create-interaction-extra-metrics-payload/index.js +14 -6
- package/dist/cjs/interaction-metrics/index.js +10 -4
- package/dist/cjs/interaction-metrics-init/index.js +4 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +21 -11
- package/dist/es2019/config/index.js +27 -23
- package/dist/es2019/create-interaction-extra-metrics-payload/index.js +6 -1
- package/dist/es2019/interaction-metrics/index.js +11 -5
- package/dist/es2019/interaction-metrics-init/index.js +4 -1
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +17 -6
- package/dist/esm/config/index.js +41 -36
- package/dist/esm/create-interaction-extra-metrics-payload/index.js +15 -7
- package/dist/esm/interaction-metrics/index.js +11 -5
- package/dist/esm/interaction-metrics-init/index.js +4 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +21 -11
- package/dist/types/config/index.d.ts +10 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -0
- package/dist/types-ts4.5/config/index.d.ts +10 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.4.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0feed18feb110`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0feed18feb110) -
|
|
8
|
+
Add sample rate config for extraInteractionMetrics
|
|
9
|
+
|
|
3
10
|
## 4.4.5
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -12,6 +12,7 @@ exports.getDoNotAbortActivePressInteraction = getDoNotAbortActivePressInteractio
|
|
|
12
12
|
exports.getDoNotAbortActivePressInteractionOnTransition = getDoNotAbortActivePressInteractionOnTransition;
|
|
13
13
|
exports.getEnabledVCRevisions = getEnabledVCRevisions;
|
|
14
14
|
exports.getExperimentalInteractionRate = getExperimentalInteractionRate;
|
|
15
|
+
exports.getExtraInteractionRate = getExtraInteractionRate;
|
|
15
16
|
exports.getInteractionRate = getInteractionRate;
|
|
16
17
|
exports.getInteractionTimeout = getInteractionTimeout;
|
|
17
18
|
exports.getMostRecentVCRevision = getMostRecentVCRevision;
|
|
@@ -182,28 +183,7 @@ function getExperimentalInteractionRate(name, interactionType) {
|
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
function getPostInteractionRate(name, interactionType) {
|
|
185
|
-
|
|
186
|
-
if (!config) {
|
|
187
|
-
return 0;
|
|
188
|
-
}
|
|
189
|
-
var _config4 = config,
|
|
190
|
-
postInteractionLog = _config4.postInteractionLog;
|
|
191
|
-
if (!(postInteractionLog !== null && postInteractionLog !== void 0 && postInteractionLog.enabled)) {
|
|
192
|
-
return 0;
|
|
193
|
-
}
|
|
194
|
-
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
195
|
-
return 0;
|
|
196
|
-
}
|
|
197
|
-
if (postInteractionLog.rates && typeof postInteractionLog.rates[name] === 'number') {
|
|
198
|
-
return postInteractionLog.rates[name];
|
|
199
|
-
}
|
|
200
|
-
if (postInteractionLog.kind && typeof postInteractionLog.kind[interactionType] === 'number') {
|
|
201
|
-
return postInteractionLog.kind[interactionType];
|
|
202
|
-
}
|
|
203
|
-
return 0;
|
|
204
|
-
} catch (e) {
|
|
205
|
-
return 0;
|
|
206
|
-
}
|
|
186
|
+
return getConfigRate(name, interactionType, 'postInteractionLog');
|
|
207
187
|
}
|
|
208
188
|
function getCapabilityRate(capability) {
|
|
209
189
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_remove_deprecated_config_fields')) {
|
|
@@ -213,8 +193,8 @@ function getCapabilityRate(capability) {
|
|
|
213
193
|
if (!config) {
|
|
214
194
|
return 0;
|
|
215
195
|
}
|
|
216
|
-
var
|
|
217
|
-
capabilityRate =
|
|
196
|
+
var _config4 = config,
|
|
197
|
+
capabilityRate = _config4.capability;
|
|
218
198
|
if (capabilityRate != null) {
|
|
219
199
|
var rate = capabilityRate[capability];
|
|
220
200
|
if (rate != null) {
|
|
@@ -226,6 +206,32 @@ function getCapabilityRate(capability) {
|
|
|
226
206
|
return 0;
|
|
227
207
|
}
|
|
228
208
|
}
|
|
209
|
+
function getConfigRate(name, interactionType, configName) {
|
|
210
|
+
try {
|
|
211
|
+
if (!config) {
|
|
212
|
+
return 0;
|
|
213
|
+
}
|
|
214
|
+
var gotConfig = config[configName];
|
|
215
|
+
if (!(gotConfig !== null && gotConfig !== void 0 && gotConfig.enabled)) {
|
|
216
|
+
return 0;
|
|
217
|
+
}
|
|
218
|
+
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
219
|
+
return 0;
|
|
220
|
+
}
|
|
221
|
+
if (gotConfig.rates && typeof gotConfig.rates[name] === 'number') {
|
|
222
|
+
return gotConfig.rates[name];
|
|
223
|
+
}
|
|
224
|
+
if ('kind' in gotConfig && gotConfig.kind && typeof gotConfig.kind[interactionType] === 'number') {
|
|
225
|
+
return gotConfig.kind[interactionType];
|
|
226
|
+
}
|
|
227
|
+
return 0;
|
|
228
|
+
} catch (e) {
|
|
229
|
+
return 0;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function getExtraInteractionRate(name, interactionType) {
|
|
233
|
+
return getConfigRate(name, interactionType, 'extraInteractionMetrics');
|
|
234
|
+
}
|
|
229
235
|
var validTypingMethods = ['timeout', 'timeoutNoAlloc', 'mutationObserver'];
|
|
230
236
|
function getTypingPerformanceTracingMethod() {
|
|
231
237
|
var defaultMethod = 'timeout';
|
|
@@ -233,8 +239,8 @@ function getTypingPerformanceTracingMethod() {
|
|
|
233
239
|
if (!config) {
|
|
234
240
|
return defaultMethod;
|
|
235
241
|
}
|
|
236
|
-
var
|
|
237
|
-
typingMethod =
|
|
242
|
+
var _config5 = config,
|
|
243
|
+
typingMethod = _config5.typingMethod;
|
|
238
244
|
if (typingMethod != null && validTypingMethods.find(function (m) {
|
|
239
245
|
return m === typingMethod;
|
|
240
246
|
})) {
|
|
@@ -253,8 +259,8 @@ function getAwaitBM3TTIList() {
|
|
|
253
259
|
if (!config) {
|
|
254
260
|
return [];
|
|
255
261
|
}
|
|
256
|
-
var
|
|
257
|
-
awaitBM3TTI =
|
|
262
|
+
var _config6 = config,
|
|
263
|
+
awaitBM3TTI = _config6.awaitBM3TTI;
|
|
258
264
|
if (awaitBM3TTI != null) {
|
|
259
265
|
return awaitBM3TTI;
|
|
260
266
|
} else {
|
|
@@ -274,8 +280,8 @@ function getUfoNameOverrides() {
|
|
|
274
280
|
if (!config) {
|
|
275
281
|
return undefined;
|
|
276
282
|
}
|
|
277
|
-
var
|
|
278
|
-
ufoNameOverrides =
|
|
283
|
+
var _config7 = config,
|
|
284
|
+
ufoNameOverrides = _config7.ufoNameOverrides;
|
|
279
285
|
if (ufoNameOverrides != null) {
|
|
280
286
|
return ufoNameOverrides;
|
|
281
287
|
}
|
|
@@ -291,8 +297,8 @@ function getDoNotAbortActivePressInteraction() {
|
|
|
291
297
|
if (!config) {
|
|
292
298
|
return undefined;
|
|
293
299
|
}
|
|
294
|
-
var
|
|
295
|
-
doNotAbortActivePressInteraction =
|
|
300
|
+
var _config8 = config,
|
|
301
|
+
doNotAbortActivePressInteraction = _config8.doNotAbortActivePressInteraction;
|
|
296
302
|
return doNotAbortActivePressInteraction;
|
|
297
303
|
} catch (e) {
|
|
298
304
|
return undefined;
|
|
@@ -305,8 +311,8 @@ function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
305
311
|
if (!config) {
|
|
306
312
|
return undefined;
|
|
307
313
|
}
|
|
308
|
-
var
|
|
309
|
-
doNotAbortActivePressInteractionOnTransition =
|
|
314
|
+
var _config9 = config,
|
|
315
|
+
doNotAbortActivePressInteractionOnTransition = _config9.doNotAbortActivePressInteractionOnTransition;
|
|
310
316
|
return doNotAbortActivePressInteractionOnTransition;
|
|
311
317
|
} catch (e) {
|
|
312
318
|
return undefined;
|
|
@@ -318,8 +324,8 @@ function getInteractionTimeout(ufoName) {
|
|
|
318
324
|
if (!config) {
|
|
319
325
|
return CLEANUP_TIMEOUT;
|
|
320
326
|
}
|
|
321
|
-
var
|
|
322
|
-
interactionTimeout =
|
|
327
|
+
var _config0 = config,
|
|
328
|
+
interactionTimeout = _config0.interactionTimeout;
|
|
323
329
|
if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
|
|
324
330
|
return interactionTimeout[ufoName];
|
|
325
331
|
}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _coinflip = _interopRequireDefault(require("../coinflip"));
|
|
10
11
|
var _config = require("../config");
|
|
11
12
|
var _createPayload = require("../create-payload");
|
|
12
13
|
var _utils = require("../create-payload/common/utils");
|
|
@@ -21,7 +22,7 @@ function createInteractionExtraLogPayload(_x, _x2) {
|
|
|
21
22
|
function _createInteractionExtraLogPayload() {
|
|
22
23
|
_createInteractionExtraLogPayload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interactionId, interaction) {
|
|
23
24
|
var _getTTAI, _finalVCMetrics$ufoV, _window$location;
|
|
24
|
-
var config, end, start, ufoName, rate, type, abortReason, routeName, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, pageVisibilityAtTTAI, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTAI, extraTTAI, newUFOName, finalVCMetrics, ttvc, payload;
|
|
25
|
+
var config, end, start, ufoName, rate, type, abortReason, routeName, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, configRate, pageVisibilityAtTTAI, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTAI, extraTTAI, newUFOName, finalVCMetrics, ttvc, payload;
|
|
25
26
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
26
27
|
while (1) switch (_context.prev = _context.next) {
|
|
27
28
|
case 0:
|
|
@@ -33,21 +34,28 @@ function _createInteractionExtraLogPayload() {
|
|
|
33
34
|
throw Error('UFO Configuration not provided');
|
|
34
35
|
case 3:
|
|
35
36
|
end = interaction.end, start = interaction.start, ufoName = interaction.ufoName, rate = interaction.rate, type = interaction.type, abortReason = interaction.abortReason, routeName = interaction.routeName, previousInteractionName = interaction.previousInteractionName, isPreviousInteractionAborted = interaction.isPreviousInteractionAborted, abortedByInteractionName = interaction.abortedByInteractionName;
|
|
37
|
+
configRate = (0, _config.getExtraInteractionRate)(ufoName, type);
|
|
38
|
+
if ((0, _coinflip.default)(configRate)) {
|
|
39
|
+
_context.next = 7;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
return _context.abrupt("return", null);
|
|
43
|
+
case 7:
|
|
36
44
|
pageVisibilityAtTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
37
45
|
isPageLoad = type === 'page_load' || type === 'transition';
|
|
38
46
|
if (isPageLoad) {
|
|
39
|
-
_context.next =
|
|
47
|
+
_context.next = 11;
|
|
40
48
|
break;
|
|
41
49
|
}
|
|
42
50
|
return _context.abrupt("return", null);
|
|
43
|
-
case
|
|
51
|
+
case 11:
|
|
44
52
|
calculatePageVisibilityFromTheStartOfPageLoad = config.enableBetterPageVisibilityApi && isPageLoad;
|
|
45
53
|
moreAccuratePageVisibilityAtTTAI = calculatePageVisibilityFromTheStartOfPageLoad ? (0, _createPayload.getMoreAccuratePageVisibilityUpToTTAI)(interaction) : null;
|
|
46
54
|
extraTTAI = (_getTTAI = (0, _getTtai.default)(interaction)) !== null && _getTTAI !== void 0 ? _getTTAI : undefined;
|
|
47
55
|
newUFOName = (0, _utils.sanitizeUfoName)(ufoName);
|
|
48
|
-
_context.next =
|
|
56
|
+
_context.next = 17;
|
|
49
57
|
return (0, _getVcMetrics.default)(interaction, true);
|
|
50
|
-
case
|
|
58
|
+
case 17:
|
|
51
59
|
finalVCMetrics = _context.sent;
|
|
52
60
|
ttvc = (_finalVCMetrics$ufoV = finalVCMetrics['ufo:vc:rev']) === null || _finalVCMetrics$ufoV === void 0 ? void 0 : _finalVCMetrics$ufoV.map(function (revision) {
|
|
53
61
|
if (revision['metric:vc90'] === null || revision.clean !== true) {
|
|
@@ -105,7 +113,7 @@ function _createInteractionExtraLogPayload() {
|
|
|
105
113
|
};
|
|
106
114
|
payload.attributes.properties['event:sizeInKb'] = (0, _getPayloadSize.default)(payload.attributes.properties);
|
|
107
115
|
return _context.abrupt("return", payload);
|
|
108
|
-
case
|
|
116
|
+
case 22:
|
|
109
117
|
case "end":
|
|
110
118
|
return _context.stop();
|
|
111
119
|
}
|
|
@@ -709,7 +709,10 @@ function finishInteraction(id, data) {
|
|
|
709
709
|
if (!((_getConfig5 = (0, _config.getConfig)()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
|
|
710
710
|
remove(id);
|
|
711
711
|
}
|
|
712
|
-
|
|
712
|
+
var _sanitisedUfoName = (0, _utils.sanitizeUfoName)(data.ufoName);
|
|
713
|
+
if (!(0, _coinflip.default)((0, _config.getExtraInteractionRate)(_sanitisedUfoName, data.type))) {
|
|
714
|
+
interactionExtraMetrics.stopVCObserver();
|
|
715
|
+
}
|
|
713
716
|
}
|
|
714
717
|
} else {
|
|
715
718
|
var _getConfig6;
|
|
@@ -1148,9 +1151,12 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
|
|
|
1148
1151
|
});
|
|
1149
1152
|
}
|
|
1150
1153
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
+
var _config$extraInteract;
|
|
1155
|
+
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
|
|
1156
|
+
interactionExtraMetrics.startVCObserver({
|
|
1157
|
+
startTime: startTime
|
|
1158
|
+
}, interactionId);
|
|
1159
|
+
}
|
|
1154
1160
|
}
|
|
1155
1161
|
}
|
|
1156
1162
|
if (type === 'press' && (0, _platformFeatureFlags.fg)('platform_ufo_enable_vc_press_interactions')) {
|
|
@@ -136,7 +136,10 @@ function init(analyticsWebClientAsync, config) {
|
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
|
|
139
|
-
|
|
139
|
+
var _config$extraInteract;
|
|
140
|
+
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
|
|
141
|
+
_interactionMetrics.interactionExtraMetrics.initializeVCObserver(vcOptions);
|
|
142
|
+
}
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
145
|
(0, _hiddenTiming.setupHiddenTimingCapture)();
|
|
@@ -85,9 +85,9 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
85
85
|
}, {
|
|
86
86
|
key: "calculateWithDebugInfo",
|
|
87
87
|
value: function () {
|
|
88
|
-
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries) {
|
|
88
|
+
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p) {
|
|
89
89
|
var _window, _window2, _window3, _window5;
|
|
90
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculateDebugDetails, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator4, _step4, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator5, _step5, _entry3, _ignoredEntriesByTime, viewportData, timestamp, additionalVcLogs, _iterator6, _step6, _step6$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window4, _window4$__ufo_devtoo, _window6, _window6$__on_ufo_vc_;
|
|
90
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator4, _step4, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator5, _step5, _entry3, _ignoredEntriesByTime, viewportData, timestamp, additionalVcLogs, _iterator6, _step6, _step6$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window4, _window4$__ufo_devtoo, _window6, _window6$__on_ufo_vc_;
|
|
91
91
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
92
92
|
while (1) switch (_context.prev = _context.next) {
|
|
93
93
|
case 0:
|
|
@@ -184,8 +184,9 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
184
184
|
return _objectSpread(_objectSpread({}, log), {}, {
|
|
185
185
|
viewportPercentage: log.viewportPercentage
|
|
186
186
|
});
|
|
187
|
-
}) : []; //
|
|
188
|
-
|
|
187
|
+
}) : []; // If 3p metric enabled - calculate the debug details
|
|
188
|
+
shouldCalculate3p = include3p && (0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p'); // Only calculate enhanced debug details if devtool callbacks exist
|
|
189
|
+
shouldCalculateDebugDetails = (!isPostInteraction || shouldCalculate3p) && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function');
|
|
189
190
|
if (shouldCalculateDebugDetails && allEntries && vcLogs) {
|
|
190
191
|
// Pre-sort vcLogs by time for efficient lookups
|
|
191
192
|
sortedVcLogs = (0, _toConsumableArray2.default)(vcLogs).sort(function (a, b) {
|
|
@@ -230,7 +231,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
230
231
|
try {
|
|
231
232
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
232
233
|
_entry3 = _step5.value;
|
|
233
|
-
if ('rect' in _entry3.data && !this.isEntryIncluded(_entry3)) {
|
|
234
|
+
if ('rect' in _entry3.data && !this.isEntryIncluded(_entry3, include3p)) {
|
|
234
235
|
viewportData = _entry3.data;
|
|
235
236
|
timestamp = Math.round(_entry3.time);
|
|
236
237
|
if (!ignoredEntriesByTime.has(timestamp)) {
|
|
@@ -287,7 +288,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
287
288
|
}
|
|
288
289
|
|
|
289
290
|
// Handle devtool callback
|
|
290
|
-
if (v3RevisionDebugDetails && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function') {
|
|
291
|
+
if (v3RevisionDebugDetails && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
|
|
291
292
|
try {
|
|
292
293
|
(_window4 = window) === null || _window4 === void 0 || (_window4$__ufo_devtoo = _window4.__ufo_devtool_onVCRevisionReady__) === null || _window4$__ufo_devtoo === void 0 || _window4$__ufo_devtoo.call(_window4, v3RevisionDebugDetails);
|
|
293
294
|
} catch (e) {
|
|
@@ -296,7 +297,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
296
297
|
console.error('Error in onVCRevisionReady', e);
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
|
-
if (v3RevisionDebugDetails && typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__on_ufo_vc_debug_data_ready) === 'function') {
|
|
300
|
+
if (v3RevisionDebugDetails && typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
|
|
300
301
|
try {
|
|
301
302
|
(_window6 = window) === null || _window6 === void 0 || (_window6$__on_ufo_vc_ = _window6.__on_ufo_vc_debug_data_ready) === null || _window6$__on_ufo_vc_ === void 0 || _window6$__on_ufo_vc_.call(_window6, v3RevisionDebugDetails);
|
|
302
303
|
} catch (e) {
|
|
@@ -304,14 +305,23 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
304
305
|
console.error('Error in onVCRevisionReady', e);
|
|
305
306
|
}
|
|
306
307
|
}
|
|
308
|
+
if (v3RevisionDebugDetails && shouldCalculate3p) {
|
|
309
|
+
try {
|
|
310
|
+
// Log vc details with 3p for debugging
|
|
311
|
+
window.__ufo_devtool_vc_3p_debug_data = v3RevisionDebugDetails;
|
|
312
|
+
} catch (e) {
|
|
313
|
+
// eslint-disable-next-line no-console
|
|
314
|
+
console.error('Error in 3pDebugData', e);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
307
317
|
return _context.abrupt("return", vcDetails);
|
|
308
|
-
case
|
|
318
|
+
case 41:
|
|
309
319
|
case "end":
|
|
310
320
|
return _context.stop();
|
|
311
321
|
}
|
|
312
322
|
}, _callee, this, [[11, 23, 26, 29]]);
|
|
313
323
|
}));
|
|
314
|
-
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8) {
|
|
324
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9) {
|
|
315
325
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
316
326
|
}
|
|
317
327
|
return calculateWithDebugInfo;
|
|
@@ -348,7 +358,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
348
358
|
} : {}));
|
|
349
359
|
case 7:
|
|
350
360
|
_context2.next = 9;
|
|
351
|
-
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries);
|
|
361
|
+
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p);
|
|
352
362
|
case 9:
|
|
353
363
|
vcDetails = _context2.sent;
|
|
354
364
|
result = {
|
|
@@ -368,7 +378,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
368
378
|
}
|
|
369
379
|
}, _callee2, this);
|
|
370
380
|
}));
|
|
371
|
-
function calculate(
|
|
381
|
+
function calculate(_x0) {
|
|
372
382
|
return _calculate.apply(this, arguments);
|
|
373
383
|
}
|
|
374
384
|
return calculate;
|
|
@@ -162,29 +162,7 @@ export function getExperimentalInteractionRate(name, interactionType) {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
export function getPostInteractionRate(name, interactionType) {
|
|
165
|
-
|
|
166
|
-
if (!config) {
|
|
167
|
-
return 0;
|
|
168
|
-
}
|
|
169
|
-
const {
|
|
170
|
-
postInteractionLog
|
|
171
|
-
} = config;
|
|
172
|
-
if (!(postInteractionLog !== null && postInteractionLog !== void 0 && postInteractionLog.enabled)) {
|
|
173
|
-
return 0;
|
|
174
|
-
}
|
|
175
|
-
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
176
|
-
return 0;
|
|
177
|
-
}
|
|
178
|
-
if (postInteractionLog.rates && typeof postInteractionLog.rates[name] === 'number') {
|
|
179
|
-
return postInteractionLog.rates[name];
|
|
180
|
-
}
|
|
181
|
-
if (postInteractionLog.kind && typeof postInteractionLog.kind[interactionType] === 'number') {
|
|
182
|
-
return postInteractionLog.kind[interactionType];
|
|
183
|
-
}
|
|
184
|
-
return 0;
|
|
185
|
-
} catch (e) {
|
|
186
|
-
return 0;
|
|
187
|
-
}
|
|
165
|
+
return getConfigRate(name, interactionType, 'postInteractionLog');
|
|
188
166
|
}
|
|
189
167
|
export function getCapabilityRate(capability) {
|
|
190
168
|
if (fg('platform_ufo_remove_deprecated_config_fields')) {
|
|
@@ -208,6 +186,32 @@ export function getCapabilityRate(capability) {
|
|
|
208
186
|
return 0;
|
|
209
187
|
}
|
|
210
188
|
}
|
|
189
|
+
function getConfigRate(name, interactionType, configName) {
|
|
190
|
+
try {
|
|
191
|
+
if (!config) {
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
const gotConfig = config[configName];
|
|
195
|
+
if (!(gotConfig !== null && gotConfig !== void 0 && gotConfig.enabled)) {
|
|
196
|
+
return 0;
|
|
197
|
+
}
|
|
198
|
+
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
199
|
+
return 0;
|
|
200
|
+
}
|
|
201
|
+
if (gotConfig.rates && typeof gotConfig.rates[name] === 'number') {
|
|
202
|
+
return gotConfig.rates[name];
|
|
203
|
+
}
|
|
204
|
+
if ('kind' in gotConfig && gotConfig.kind && typeof gotConfig.kind[interactionType] === 'number') {
|
|
205
|
+
return gotConfig.kind[interactionType];
|
|
206
|
+
}
|
|
207
|
+
return 0;
|
|
208
|
+
} catch (e) {
|
|
209
|
+
return 0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
export function getExtraInteractionRate(name, interactionType) {
|
|
213
|
+
return getConfigRate(name, interactionType, 'extraInteractionMetrics');
|
|
214
|
+
}
|
|
211
215
|
const validTypingMethods = ['timeout', 'timeoutNoAlloc', 'mutationObserver'];
|
|
212
216
|
export function getTypingPerformanceTracingMethod() {
|
|
213
217
|
const defaultMethod = 'timeout';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import coinflip from '../coinflip';
|
|
2
|
+
import { getConfig, getExtraInteractionRate } from '../config';
|
|
2
3
|
import { getMoreAccuratePageVisibilityUpToTTAI } from '../create-payload';
|
|
3
4
|
import { sanitizeUfoName } from '../create-payload/common/utils';
|
|
4
5
|
import getPageVisibilityUpToTTAI from '../create-payload/utils/get-page-visibility-up-to-ttai';
|
|
@@ -24,6 +25,10 @@ async function createInteractionExtraLogPayload(interactionId, interaction) {
|
|
|
24
25
|
isPreviousInteractionAborted,
|
|
25
26
|
abortedByInteractionName
|
|
26
27
|
} = interaction;
|
|
28
|
+
const configRate = getExtraInteractionRate(ufoName, type);
|
|
29
|
+
if (!coinflip(configRate)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
27
32
|
const pageVisibilityAtTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
28
33
|
const isPageLoad = type === 'page_load' || type === 'transition';
|
|
29
34
|
if (!isPageLoad) {
|
|
@@ -2,7 +2,7 @@ import { v4 as createUUID } from 'uuid';
|
|
|
2
2
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import coinflip from '../coinflip';
|
|
5
|
-
import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
5
|
+
import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getExtraInteractionRate, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
6
6
|
import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
|
|
7
7
|
import { sanitizeUfoName, stringifyLabelStackFully } from '../create-payload/common/utils';
|
|
8
8
|
import { clearActiveTrace } from '../experience-trace-id-context';
|
|
@@ -627,7 +627,10 @@ function finishInteraction(id, data, endTime = performance.now()) {
|
|
|
627
627
|
if (!((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5$experimen = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5$experimen !== void 0 && _getConfig5$experimen.enabled)) {
|
|
628
628
|
remove(id);
|
|
629
629
|
}
|
|
630
|
-
|
|
630
|
+
const sanitisedUfoName = sanitizeUfoName(data.ufoName);
|
|
631
|
+
if (!coinflip(getExtraInteractionRate(sanitisedUfoName, data.type))) {
|
|
632
|
+
interactionExtraMetrics.stopVCObserver();
|
|
633
|
+
}
|
|
631
634
|
}
|
|
632
635
|
} else {
|
|
633
636
|
var _getConfig6, _getConfig6$experimen;
|
|
@@ -1026,9 +1029,12 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
1026
1029
|
});
|
|
1027
1030
|
}
|
|
1028
1031
|
if (fg('platform_ufo_enable_ttai_with_3p')) {
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
+
var _config$extraInteract;
|
|
1033
|
+
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
|
|
1034
|
+
interactionExtraMetrics.startVCObserver({
|
|
1035
|
+
startTime
|
|
1036
|
+
}, interactionId);
|
|
1037
|
+
}
|
|
1032
1038
|
}
|
|
1033
1039
|
}
|
|
1034
1040
|
if (type === 'press' && fg('platform_ufo_enable_vc_press_interactions')) {
|
|
@@ -112,7 +112,10 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
if (fg('platform_ufo_enable_ttai_with_3p')) {
|
|
115
|
-
|
|
115
|
+
var _config$extraInteract;
|
|
116
|
+
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
|
|
117
|
+
interactionExtraMetrics.initializeVCObserver(vcOptions);
|
|
118
|
+
}
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
setupHiddenTimingCapture();
|
|
@@ -40,7 +40,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
40
40
|
}
|
|
41
41
|
return ratios;
|
|
42
42
|
}
|
|
43
|
-
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries) {
|
|
43
|
+
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p) {
|
|
44
44
|
var _window, _window2, _window3, _window5;
|
|
45
45
|
const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
|
|
46
46
|
if (fg('platform_ufo_send_vc_100')) {
|
|
@@ -112,8 +112,10 @@ export default class AbstractVCCalculatorBase {
|
|
|
112
112
|
viewportPercentage: log.viewportPercentage
|
|
113
113
|
})) : [];
|
|
114
114
|
|
|
115
|
+
// If 3p metric enabled - calculate the debug details
|
|
116
|
+
const shouldCalculate3p = include3p && fg('platform_ufo_enable_ttai_with_3p');
|
|
115
117
|
// Only calculate enhanced debug details if devtool callbacks exist
|
|
116
|
-
const shouldCalculateDebugDetails = !isPostInteraction && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function');
|
|
118
|
+
const shouldCalculateDebugDetails = (!isPostInteraction || shouldCalculate3p) && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function');
|
|
117
119
|
if (shouldCalculateDebugDetails && allEntries && vcLogs) {
|
|
118
120
|
// Pre-sort vcLogs by time for efficient lookups
|
|
119
121
|
const sortedVcLogs = [...vcLogs].sort((a, b) => a.time - b.time);
|
|
@@ -149,7 +151,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
149
151
|
// Group ignored entries by timestamp
|
|
150
152
|
const ignoredEntriesByTime = new Map();
|
|
151
153
|
for (const entry of allEntries) {
|
|
152
|
-
if ('rect' in entry.data && !this.isEntryIncluded(entry)) {
|
|
154
|
+
if ('rect' in entry.data && !this.isEntryIncluded(entry, include3p)) {
|
|
153
155
|
var _ignoredEntriesByTime;
|
|
154
156
|
const viewportData = entry.data;
|
|
155
157
|
const timestamp = Math.round(entry.time);
|
|
@@ -193,7 +195,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
// Handle devtool callback
|
|
196
|
-
if (v3RevisionDebugDetails && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function') {
|
|
198
|
+
if (v3RevisionDebugDetails && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
|
|
197
199
|
try {
|
|
198
200
|
var _window4, _window4$__ufo_devtoo;
|
|
199
201
|
(_window4 = window) === null || _window4 === void 0 ? void 0 : (_window4$__ufo_devtoo = _window4.__ufo_devtool_onVCRevisionReady__) === null || _window4$__ufo_devtoo === void 0 ? void 0 : _window4$__ufo_devtoo.call(_window4, v3RevisionDebugDetails);
|
|
@@ -203,7 +205,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
203
205
|
console.error('Error in onVCRevisionReady', e);
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
|
-
if (v3RevisionDebugDetails && typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__on_ufo_vc_debug_data_ready) === 'function') {
|
|
208
|
+
if (v3RevisionDebugDetails && typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
|
|
207
209
|
try {
|
|
208
210
|
var _window6, _window6$__on_ufo_vc_;
|
|
209
211
|
(_window6 = window) === null || _window6 === void 0 ? void 0 : (_window6$__on_ufo_vc_ = _window6.__on_ufo_vc_debug_data_ready) === null || _window6$__on_ufo_vc_ === void 0 ? void 0 : _window6$__on_ufo_vc_.call(_window6, v3RevisionDebugDetails);
|
|
@@ -212,6 +214,15 @@ export default class AbstractVCCalculatorBase {
|
|
|
212
214
|
console.error('Error in onVCRevisionReady', e);
|
|
213
215
|
}
|
|
214
216
|
}
|
|
217
|
+
if (v3RevisionDebugDetails && shouldCalculate3p) {
|
|
218
|
+
try {
|
|
219
|
+
// Log vc details with 3p for debugging
|
|
220
|
+
window.__ufo_devtool_vc_3p_debug_data = v3RevisionDebugDetails;
|
|
221
|
+
} catch (e) {
|
|
222
|
+
// eslint-disable-next-line no-console
|
|
223
|
+
console.error('Error in 3pDebugData', e);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
215
226
|
return vcDetails;
|
|
216
227
|
}
|
|
217
228
|
async calculate({
|
|
@@ -242,7 +253,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
242
253
|
} : {})
|
|
243
254
|
};
|
|
244
255
|
}
|
|
245
|
-
const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries);
|
|
256
|
+
const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p);
|
|
246
257
|
const result = {
|
|
247
258
|
revision: this.revisionNo,
|
|
248
259
|
clean: true,
|
package/dist/esm/config/index.js
CHANGED
|
@@ -159,28 +159,7 @@ export function getExperimentalInteractionRate(name, interactionType) {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
export function getPostInteractionRate(name, interactionType) {
|
|
162
|
-
|
|
163
|
-
if (!config) {
|
|
164
|
-
return 0;
|
|
165
|
-
}
|
|
166
|
-
var _config4 = config,
|
|
167
|
-
postInteractionLog = _config4.postInteractionLog;
|
|
168
|
-
if (!(postInteractionLog !== null && postInteractionLog !== void 0 && postInteractionLog.enabled)) {
|
|
169
|
-
return 0;
|
|
170
|
-
}
|
|
171
|
-
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
172
|
-
return 0;
|
|
173
|
-
}
|
|
174
|
-
if (postInteractionLog.rates && typeof postInteractionLog.rates[name] === 'number') {
|
|
175
|
-
return postInteractionLog.rates[name];
|
|
176
|
-
}
|
|
177
|
-
if (postInteractionLog.kind && typeof postInteractionLog.kind[interactionType] === 'number') {
|
|
178
|
-
return postInteractionLog.kind[interactionType];
|
|
179
|
-
}
|
|
180
|
-
return 0;
|
|
181
|
-
} catch (e) {
|
|
182
|
-
return 0;
|
|
183
|
-
}
|
|
162
|
+
return getConfigRate(name, interactionType, 'postInteractionLog');
|
|
184
163
|
}
|
|
185
164
|
export function getCapabilityRate(capability) {
|
|
186
165
|
if (fg('platform_ufo_remove_deprecated_config_fields')) {
|
|
@@ -190,8 +169,8 @@ export function getCapabilityRate(capability) {
|
|
|
190
169
|
if (!config) {
|
|
191
170
|
return 0;
|
|
192
171
|
}
|
|
193
|
-
var
|
|
194
|
-
capabilityRate =
|
|
172
|
+
var _config4 = config,
|
|
173
|
+
capabilityRate = _config4.capability;
|
|
195
174
|
if (capabilityRate != null) {
|
|
196
175
|
var rate = capabilityRate[capability];
|
|
197
176
|
if (rate != null) {
|
|
@@ -203,6 +182,32 @@ export function getCapabilityRate(capability) {
|
|
|
203
182
|
return 0;
|
|
204
183
|
}
|
|
205
184
|
}
|
|
185
|
+
function getConfigRate(name, interactionType, configName) {
|
|
186
|
+
try {
|
|
187
|
+
if (!config) {
|
|
188
|
+
return 0;
|
|
189
|
+
}
|
|
190
|
+
var gotConfig = config[configName];
|
|
191
|
+
if (!(gotConfig !== null && gotConfig !== void 0 && gotConfig.enabled)) {
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
if (gotConfig.rates && typeof gotConfig.rates[name] === 'number') {
|
|
198
|
+
return gotConfig.rates[name];
|
|
199
|
+
}
|
|
200
|
+
if ('kind' in gotConfig && gotConfig.kind && typeof gotConfig.kind[interactionType] === 'number') {
|
|
201
|
+
return gotConfig.kind[interactionType];
|
|
202
|
+
}
|
|
203
|
+
return 0;
|
|
204
|
+
} catch (e) {
|
|
205
|
+
return 0;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
export function getExtraInteractionRate(name, interactionType) {
|
|
209
|
+
return getConfigRate(name, interactionType, 'extraInteractionMetrics');
|
|
210
|
+
}
|
|
206
211
|
var validTypingMethods = ['timeout', 'timeoutNoAlloc', 'mutationObserver'];
|
|
207
212
|
export function getTypingPerformanceTracingMethod() {
|
|
208
213
|
var defaultMethod = 'timeout';
|
|
@@ -210,8 +215,8 @@ export function getTypingPerformanceTracingMethod() {
|
|
|
210
215
|
if (!config) {
|
|
211
216
|
return defaultMethod;
|
|
212
217
|
}
|
|
213
|
-
var
|
|
214
|
-
typingMethod =
|
|
218
|
+
var _config5 = config,
|
|
219
|
+
typingMethod = _config5.typingMethod;
|
|
215
220
|
if (typingMethod != null && validTypingMethods.find(function (m) {
|
|
216
221
|
return m === typingMethod;
|
|
217
222
|
})) {
|
|
@@ -230,8 +235,8 @@ export function getAwaitBM3TTIList() {
|
|
|
230
235
|
if (!config) {
|
|
231
236
|
return [];
|
|
232
237
|
}
|
|
233
|
-
var
|
|
234
|
-
awaitBM3TTI =
|
|
238
|
+
var _config6 = config,
|
|
239
|
+
awaitBM3TTI = _config6.awaitBM3TTI;
|
|
235
240
|
if (awaitBM3TTI != null) {
|
|
236
241
|
return awaitBM3TTI;
|
|
237
242
|
} else {
|
|
@@ -251,8 +256,8 @@ export function getUfoNameOverrides() {
|
|
|
251
256
|
if (!config) {
|
|
252
257
|
return undefined;
|
|
253
258
|
}
|
|
254
|
-
var
|
|
255
|
-
ufoNameOverrides =
|
|
259
|
+
var _config7 = config,
|
|
260
|
+
ufoNameOverrides = _config7.ufoNameOverrides;
|
|
256
261
|
if (ufoNameOverrides != null) {
|
|
257
262
|
return ufoNameOverrides;
|
|
258
263
|
}
|
|
@@ -268,8 +273,8 @@ export function getDoNotAbortActivePressInteraction() {
|
|
|
268
273
|
if (!config) {
|
|
269
274
|
return undefined;
|
|
270
275
|
}
|
|
271
|
-
var
|
|
272
|
-
doNotAbortActivePressInteraction =
|
|
276
|
+
var _config8 = config,
|
|
277
|
+
doNotAbortActivePressInteraction = _config8.doNotAbortActivePressInteraction;
|
|
273
278
|
return doNotAbortActivePressInteraction;
|
|
274
279
|
} catch (e) {
|
|
275
280
|
return undefined;
|
|
@@ -282,8 +287,8 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
282
287
|
if (!config) {
|
|
283
288
|
return undefined;
|
|
284
289
|
}
|
|
285
|
-
var
|
|
286
|
-
doNotAbortActivePressInteractionOnTransition =
|
|
290
|
+
var _config9 = config,
|
|
291
|
+
doNotAbortActivePressInteractionOnTransition = _config9.doNotAbortActivePressInteractionOnTransition;
|
|
287
292
|
return doNotAbortActivePressInteractionOnTransition;
|
|
288
293
|
} catch (e) {
|
|
289
294
|
return undefined;
|
|
@@ -295,8 +300,8 @@ export function getInteractionTimeout(ufoName) {
|
|
|
295
300
|
if (!config) {
|
|
296
301
|
return CLEANUP_TIMEOUT;
|
|
297
302
|
}
|
|
298
|
-
var
|
|
299
|
-
interactionTimeout =
|
|
303
|
+
var _config0 = config,
|
|
304
|
+
interactionTimeout = _config0.interactionTimeout;
|
|
300
305
|
if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
|
|
301
306
|
return interactionTimeout[ufoName];
|
|
302
307
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import
|
|
3
|
+
import coinflip from '../coinflip';
|
|
4
|
+
import { getConfig, getExtraInteractionRate } from '../config';
|
|
4
5
|
import { getMoreAccuratePageVisibilityUpToTTAI } from '../create-payload';
|
|
5
6
|
import { sanitizeUfoName } from '../create-payload/common/utils';
|
|
6
7
|
import getPageVisibilityUpToTTAI from '../create-payload/utils/get-page-visibility-up-to-ttai';
|
|
@@ -14,7 +15,7 @@ function createInteractionExtraLogPayload(_x, _x2) {
|
|
|
14
15
|
function _createInteractionExtraLogPayload() {
|
|
15
16
|
_createInteractionExtraLogPayload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interactionId, interaction) {
|
|
16
17
|
var _getTTAI, _finalVCMetrics$ufoV, _window$location;
|
|
17
|
-
var config, end, start, ufoName, rate, type, abortReason, routeName, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, pageVisibilityAtTTAI, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTAI, extraTTAI, newUFOName, finalVCMetrics, ttvc, payload;
|
|
18
|
+
var config, end, start, ufoName, rate, type, abortReason, routeName, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, configRate, pageVisibilityAtTTAI, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTAI, extraTTAI, newUFOName, finalVCMetrics, ttvc, payload;
|
|
18
19
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
19
20
|
while (1) switch (_context.prev = _context.next) {
|
|
20
21
|
case 0:
|
|
@@ -26,21 +27,28 @@ function _createInteractionExtraLogPayload() {
|
|
|
26
27
|
throw Error('UFO Configuration not provided');
|
|
27
28
|
case 3:
|
|
28
29
|
end = interaction.end, start = interaction.start, ufoName = interaction.ufoName, rate = interaction.rate, type = interaction.type, abortReason = interaction.abortReason, routeName = interaction.routeName, previousInteractionName = interaction.previousInteractionName, isPreviousInteractionAborted = interaction.isPreviousInteractionAborted, abortedByInteractionName = interaction.abortedByInteractionName;
|
|
30
|
+
configRate = getExtraInteractionRate(ufoName, type);
|
|
31
|
+
if (coinflip(configRate)) {
|
|
32
|
+
_context.next = 7;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
return _context.abrupt("return", null);
|
|
36
|
+
case 7:
|
|
29
37
|
pageVisibilityAtTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
30
38
|
isPageLoad = type === 'page_load' || type === 'transition';
|
|
31
39
|
if (isPageLoad) {
|
|
32
|
-
_context.next =
|
|
40
|
+
_context.next = 11;
|
|
33
41
|
break;
|
|
34
42
|
}
|
|
35
43
|
return _context.abrupt("return", null);
|
|
36
|
-
case
|
|
44
|
+
case 11:
|
|
37
45
|
calculatePageVisibilityFromTheStartOfPageLoad = config.enableBetterPageVisibilityApi && isPageLoad;
|
|
38
46
|
moreAccuratePageVisibilityAtTTAI = calculatePageVisibilityFromTheStartOfPageLoad ? getMoreAccuratePageVisibilityUpToTTAI(interaction) : null;
|
|
39
47
|
extraTTAI = (_getTTAI = getTTAI(interaction)) !== null && _getTTAI !== void 0 ? _getTTAI : undefined;
|
|
40
48
|
newUFOName = sanitizeUfoName(ufoName);
|
|
41
|
-
_context.next =
|
|
49
|
+
_context.next = 17;
|
|
42
50
|
return getVCMetrics(interaction, true);
|
|
43
|
-
case
|
|
51
|
+
case 17:
|
|
44
52
|
finalVCMetrics = _context.sent;
|
|
45
53
|
ttvc = (_finalVCMetrics$ufoV = finalVCMetrics['ufo:vc:rev']) === null || _finalVCMetrics$ufoV === void 0 ? void 0 : _finalVCMetrics$ufoV.map(function (revision) {
|
|
46
54
|
if (revision['metric:vc90'] === null || revision.clean !== true) {
|
|
@@ -98,7 +106,7 @@ function _createInteractionExtraLogPayload() {
|
|
|
98
106
|
};
|
|
99
107
|
payload.attributes.properties['event:sizeInKb'] = getPayloadSize(payload.attributes.properties);
|
|
100
108
|
return _context.abrupt("return", payload);
|
|
101
|
-
case
|
|
109
|
+
case 22:
|
|
102
110
|
case "end":
|
|
103
111
|
return _context.stop();
|
|
104
112
|
}
|
|
@@ -12,7 +12,7 @@ import { v4 as createUUID } from 'uuid';
|
|
|
12
12
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import coinflip from '../coinflip';
|
|
15
|
-
import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
15
|
+
import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getExtraInteractionRate, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
16
16
|
import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
|
|
17
17
|
import { sanitizeUfoName, stringifyLabelStackFully } from '../create-payload/common/utils';
|
|
18
18
|
import { clearActiveTrace } from '../experience-trace-id-context';
|
|
@@ -663,7 +663,10 @@ function finishInteraction(id, data) {
|
|
|
663
663
|
if (!((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
|
|
664
664
|
remove(id);
|
|
665
665
|
}
|
|
666
|
-
|
|
666
|
+
var _sanitisedUfoName = sanitizeUfoName(data.ufoName);
|
|
667
|
+
if (!coinflip(getExtraInteractionRate(_sanitisedUfoName, data.type))) {
|
|
668
|
+
interactionExtraMetrics.stopVCObserver();
|
|
669
|
+
}
|
|
667
670
|
}
|
|
668
671
|
} else {
|
|
669
672
|
var _getConfig6;
|
|
@@ -1102,9 +1105,12 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
1102
1105
|
});
|
|
1103
1106
|
}
|
|
1104
1107
|
if (fg('platform_ufo_enable_ttai_with_3p')) {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
+
var _config$extraInteract;
|
|
1109
|
+
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
|
|
1110
|
+
interactionExtraMetrics.startVCObserver({
|
|
1111
|
+
startTime: startTime
|
|
1112
|
+
}, interactionId);
|
|
1113
|
+
}
|
|
1108
1114
|
}
|
|
1109
1115
|
}
|
|
1110
1116
|
if (type === 'press' && fg('platform_ufo_enable_vc_press_interactions')) {
|
|
@@ -127,7 +127,10 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
if (fg('platform_ufo_enable_ttai_with_3p')) {
|
|
130
|
-
|
|
130
|
+
var _config$extraInteract;
|
|
131
|
+
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
|
|
132
|
+
interactionExtraMetrics.initializeVCObserver(vcOptions);
|
|
133
|
+
}
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
136
|
setupHiddenTimingCapture();
|
|
@@ -79,9 +79,9 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
79
79
|
}, {
|
|
80
80
|
key: "calculateWithDebugInfo",
|
|
81
81
|
value: function () {
|
|
82
|
-
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries) {
|
|
82
|
+
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p) {
|
|
83
83
|
var _window, _window2, _window3, _window5;
|
|
84
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculateDebugDetails, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator4, _step4, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator5, _step5, _entry3, _ignoredEntriesByTime, viewportData, timestamp, additionalVcLogs, _iterator6, _step6, _step6$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window4, _window4$__ufo_devtoo, _window6, _window6$__on_ufo_vc_;
|
|
84
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator4, _step4, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator5, _step5, _entry3, _ignoredEntriesByTime, viewportData, timestamp, additionalVcLogs, _iterator6, _step6, _step6$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window4, _window4$__ufo_devtoo, _window6, _window6$__on_ufo_vc_;
|
|
85
85
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
86
86
|
while (1) switch (_context.prev = _context.next) {
|
|
87
87
|
case 0:
|
|
@@ -178,8 +178,9 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
178
178
|
return _objectSpread(_objectSpread({}, log), {}, {
|
|
179
179
|
viewportPercentage: log.viewportPercentage
|
|
180
180
|
});
|
|
181
|
-
}) : []; //
|
|
182
|
-
|
|
181
|
+
}) : []; // If 3p metric enabled - calculate the debug details
|
|
182
|
+
shouldCalculate3p = include3p && fg('platform_ufo_enable_ttai_with_3p'); // Only calculate enhanced debug details if devtool callbacks exist
|
|
183
|
+
shouldCalculateDebugDetails = (!isPostInteraction || shouldCalculate3p) && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function');
|
|
183
184
|
if (shouldCalculateDebugDetails && allEntries && vcLogs) {
|
|
184
185
|
// Pre-sort vcLogs by time for efficient lookups
|
|
185
186
|
sortedVcLogs = _toConsumableArray(vcLogs).sort(function (a, b) {
|
|
@@ -224,7 +225,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
224
225
|
try {
|
|
225
226
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
226
227
|
_entry3 = _step5.value;
|
|
227
|
-
if ('rect' in _entry3.data && !this.isEntryIncluded(_entry3)) {
|
|
228
|
+
if ('rect' in _entry3.data && !this.isEntryIncluded(_entry3, include3p)) {
|
|
228
229
|
viewportData = _entry3.data;
|
|
229
230
|
timestamp = Math.round(_entry3.time);
|
|
230
231
|
if (!ignoredEntriesByTime.has(timestamp)) {
|
|
@@ -281,7 +282,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
// Handle devtool callback
|
|
284
|
-
if (v3RevisionDebugDetails && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function') {
|
|
285
|
+
if (v3RevisionDebugDetails && typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
|
|
285
286
|
try {
|
|
286
287
|
(_window4 = window) === null || _window4 === void 0 || (_window4$__ufo_devtoo = _window4.__ufo_devtool_onVCRevisionReady__) === null || _window4$__ufo_devtoo === void 0 || _window4$__ufo_devtoo.call(_window4, v3RevisionDebugDetails);
|
|
287
288
|
} catch (e) {
|
|
@@ -290,7 +291,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
290
291
|
console.error('Error in onVCRevisionReady', e);
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
|
-
if (v3RevisionDebugDetails && typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__on_ufo_vc_debug_data_ready) === 'function') {
|
|
294
|
+
if (v3RevisionDebugDetails && typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
|
|
294
295
|
try {
|
|
295
296
|
(_window6 = window) === null || _window6 === void 0 || (_window6$__on_ufo_vc_ = _window6.__on_ufo_vc_debug_data_ready) === null || _window6$__on_ufo_vc_ === void 0 || _window6$__on_ufo_vc_.call(_window6, v3RevisionDebugDetails);
|
|
296
297
|
} catch (e) {
|
|
@@ -298,14 +299,23 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
298
299
|
console.error('Error in onVCRevisionReady', e);
|
|
299
300
|
}
|
|
300
301
|
}
|
|
302
|
+
if (v3RevisionDebugDetails && shouldCalculate3p) {
|
|
303
|
+
try {
|
|
304
|
+
// Log vc details with 3p for debugging
|
|
305
|
+
window.__ufo_devtool_vc_3p_debug_data = v3RevisionDebugDetails;
|
|
306
|
+
} catch (e) {
|
|
307
|
+
// eslint-disable-next-line no-console
|
|
308
|
+
console.error('Error in 3pDebugData', e);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
301
311
|
return _context.abrupt("return", vcDetails);
|
|
302
|
-
case
|
|
312
|
+
case 41:
|
|
303
313
|
case "end":
|
|
304
314
|
return _context.stop();
|
|
305
315
|
}
|
|
306
316
|
}, _callee, this, [[11, 23, 26, 29]]);
|
|
307
317
|
}));
|
|
308
|
-
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8) {
|
|
318
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9) {
|
|
309
319
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
310
320
|
}
|
|
311
321
|
return calculateWithDebugInfo;
|
|
@@ -342,7 +352,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
342
352
|
} : {}));
|
|
343
353
|
case 7:
|
|
344
354
|
_context2.next = 9;
|
|
345
|
-
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries);
|
|
355
|
+
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p);
|
|
346
356
|
case 9:
|
|
347
357
|
vcDetails = _context2.sent;
|
|
348
358
|
result = {
|
|
@@ -362,7 +372,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
362
372
|
}
|
|
363
373
|
}, _callee2, this);
|
|
364
374
|
}));
|
|
365
|
-
function calculate(
|
|
375
|
+
function calculate(_x0) {
|
|
366
376
|
return _calculate.apply(this, arguments);
|
|
367
377
|
}
|
|
368
378
|
return calculate;
|
|
@@ -2,6 +2,11 @@ import type { AssetsConfig, InteractionMetrics, InteractionType } from '../commo
|
|
|
2
2
|
export interface AdditionalData {
|
|
3
3
|
[key: string]: null | string | number | boolean | undefined | AdditionalData | Record<string, AdditionalData> | Array<AdditionalData>;
|
|
4
4
|
}
|
|
5
|
+
interface InteractionMetricsConfig {
|
|
6
|
+
readonly enabled?: boolean;
|
|
7
|
+
readonly rates?: Rates;
|
|
8
|
+
readonly kind?: Record<InteractionType, number>;
|
|
9
|
+
}
|
|
5
10
|
export interface SSRTiming {
|
|
6
11
|
label: string;
|
|
7
12
|
data: {
|
|
@@ -138,6 +143,10 @@ export type Config = {
|
|
|
138
143
|
* Return {@code null} if hydration was not attempted or if we do not want to report any stats.
|
|
139
144
|
*/
|
|
140
145
|
readonly getReactHydrationStats?: (() => ReactHydrationStats | undefined) | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* Whether ttvc with 3p measurement is enabled and sent new event for experiences with sample rates
|
|
148
|
+
*/
|
|
149
|
+
readonly extraInteractionMetrics?: InteractionMetricsConfig;
|
|
141
150
|
};
|
|
142
151
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
143
152
|
export declare function getConfig(): Config | undefined;
|
|
@@ -149,6 +158,7 @@ export declare function getInteractionRate(name: string, interactionKind: Intera
|
|
|
149
158
|
export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
|
|
150
159
|
export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
|
|
151
160
|
export declare function getCapabilityRate(capability: Capability): number;
|
|
161
|
+
export declare function getExtraInteractionRate(name: string, interactionType: InteractionType): number;
|
|
152
162
|
declare const validTypingMethods: readonly ["timeout", "timeoutNoAlloc", "mutationObserver"];
|
|
153
163
|
type ValidTypingMethod = (typeof validTypingMethods)[number];
|
|
154
164
|
export declare function getTypingPerformanceTracingMethod(): ValidTypingMethod;
|
|
@@ -6,6 +6,7 @@ declare global {
|
|
|
6
6
|
interface Window {
|
|
7
7
|
__ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
8
8
|
__on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
9
|
+
__ufo_devtool_vc_3p_debug_data?: VCRevisionDebugDetails;
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
export default abstract class AbstractVCCalculatorBase implements VCCalculator {
|
|
@@ -2,6 +2,11 @@ import type { AssetsConfig, InteractionMetrics, InteractionType } from '../commo
|
|
|
2
2
|
export interface AdditionalData {
|
|
3
3
|
[key: string]: null | string | number | boolean | undefined | AdditionalData | Record<string, AdditionalData> | Array<AdditionalData>;
|
|
4
4
|
}
|
|
5
|
+
interface InteractionMetricsConfig {
|
|
6
|
+
readonly enabled?: boolean;
|
|
7
|
+
readonly rates?: Rates;
|
|
8
|
+
readonly kind?: Record<InteractionType, number>;
|
|
9
|
+
}
|
|
5
10
|
export interface SSRTiming {
|
|
6
11
|
label: string;
|
|
7
12
|
data: {
|
|
@@ -138,6 +143,10 @@ export type Config = {
|
|
|
138
143
|
* Return {@code null} if hydration was not attempted or if we do not want to report any stats.
|
|
139
144
|
*/
|
|
140
145
|
readonly getReactHydrationStats?: (() => ReactHydrationStats | undefined) | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* Whether ttvc with 3p measurement is enabled and sent new event for experiences with sample rates
|
|
148
|
+
*/
|
|
149
|
+
readonly extraInteractionMetrics?: InteractionMetricsConfig;
|
|
141
150
|
};
|
|
142
151
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
143
152
|
export declare function getConfig(): Config | undefined;
|
|
@@ -149,6 +158,7 @@ export declare function getInteractionRate(name: string, interactionKind: Intera
|
|
|
149
158
|
export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
|
|
150
159
|
export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
|
|
151
160
|
export declare function getCapabilityRate(capability: Capability): number;
|
|
161
|
+
export declare function getExtraInteractionRate(name: string, interactionType: InteractionType): number;
|
|
152
162
|
declare const validTypingMethods: readonly [
|
|
153
163
|
"timeout",
|
|
154
164
|
"timeoutNoAlloc",
|
package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare global {
|
|
|
6
6
|
interface Window {
|
|
7
7
|
__ufo_devtool_onVCRevisionReady__?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
8
8
|
__on_ufo_vc_debug_data_ready?: (debugInfo: VCRevisionDebugDetails) => void;
|
|
9
|
+
__ufo_devtool_vc_3p_debug_data?: VCRevisionDebugDetails;
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
export default abstract class AbstractVCCalculatorBase implements VCCalculator {
|