@atlaskit/react-ufo 4.10.1 → 4.10.2
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 +9 -0
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +10 -7
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +13 -9
- package/dist/cjs/interaction-metrics/post-interaction-log.js +13 -6
- package/dist/cjs/vc/index.js +4 -1
- package/dist/cjs/vc/vc-observer-new/index.js +10 -4
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +11 -18
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +5 -2
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +5 -2
- package/dist/es2019/interaction-metrics/post-interaction-log.js +7 -1
- package/dist/es2019/vc/index.js +4 -1
- package/dist/es2019/vc/vc-observer-new/index.js +11 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +10 -15
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +10 -7
- package/dist/esm/create-payload/utils/get-vc-metrics.js +13 -9
- package/dist/esm/interaction-metrics/post-interaction-log.js +13 -6
- package/dist/esm/vc/index.js +4 -1
- package/dist/esm/vc/vc-observer-new/index.js +10 -4
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +11 -18
- package/dist/types/vc/types.d.ts +4 -0
- package/dist/types/vc/vc-observer/getVCRevisionDebugDetails.d.ts +2 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/types.d.ts +4 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +4 -0
- package/dist/types-ts4.5/vc/types.d.ts +4 -0
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionDebugDetails.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/types.d.ts +4 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.10.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4b8df6fc79b12`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b8df6fc79b12) -
|
|
8
|
+
Add interactionType to VC debugData
|
|
9
|
+
- [`4b8df6fc79b12`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b8df6fc79b12) -
|
|
10
|
+
bugfixes on VC debug data
|
|
11
|
+
|
|
3
12
|
## 4.10.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -95,18 +95,19 @@ function getExperimentalVCMetrics(_x) {
|
|
|
95
95
|
}
|
|
96
96
|
function _getExperimentalVCMetrics() {
|
|
97
97
|
_getExperimentalVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
|
|
98
|
-
var vcObserver, _interaction$apdex, prefix, result, VC
|
|
98
|
+
var vcObserver, pageVisibilityUpToTTAI, _interaction$apdex, prefix, result, VC;
|
|
99
99
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
100
100
|
while (1) switch (_context.prev = _context.next) {
|
|
101
101
|
case 0:
|
|
102
102
|
// Use per-interaction VC observer if available, otherwise fall back to global experimentalVC
|
|
103
103
|
vcObserver = interaction.experimentalVCObserver || experimentalVC.vcObserver;
|
|
104
|
+
pageVisibilityUpToTTAI = (0, _hiddenTiming.getPageVisibilityState)(interaction.start, interaction.end);
|
|
104
105
|
if (!vcObserver) {
|
|
105
106
|
_context.next = 13;
|
|
106
107
|
break;
|
|
107
108
|
}
|
|
108
109
|
prefix = 'ufo-experimental';
|
|
109
|
-
_context.next =
|
|
110
|
+
_context.next = 6;
|
|
110
111
|
return vcObserver.getVCResult({
|
|
111
112
|
start: interaction.start,
|
|
112
113
|
stop: interaction.end,
|
|
@@ -115,18 +116,20 @@ function _getExperimentalVCMetrics() {
|
|
|
115
116
|
prefix: prefix,
|
|
116
117
|
vc: interaction.vc,
|
|
117
118
|
experienceKey: interaction.ufoName,
|
|
118
|
-
interactionId: interaction.id
|
|
119
|
+
interactionId: interaction.id,
|
|
120
|
+
interactionType: interaction.type,
|
|
121
|
+
isPageVisible: pageVisibilityUpToTTAI === 'visible',
|
|
122
|
+
interactionAbortReason: interaction.abortReason
|
|
119
123
|
});
|
|
120
|
-
case
|
|
124
|
+
case 6:
|
|
121
125
|
result = _context.sent;
|
|
122
126
|
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
123
127
|
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
124
|
-
_context.next =
|
|
128
|
+
_context.next = 10;
|
|
125
129
|
break;
|
|
126
130
|
}
|
|
127
131
|
return _context.abrupt("return", result);
|
|
128
|
-
case
|
|
129
|
-
pageVisibilityUpToTTAI = (0, _hiddenTiming.getPageVisibilityState)(interaction.start, interaction.end);
|
|
132
|
+
case 10:
|
|
130
133
|
if (!(interaction.abortReason || pageVisibilityUpToTTAI !== 'visible')) {
|
|
131
134
|
_context.next = 12;
|
|
132
135
|
break;
|
|
@@ -26,6 +26,7 @@ function _getVCMetrics() {
|
|
|
26
26
|
config,
|
|
27
27
|
interactionStatus,
|
|
28
28
|
pageVisibilityUpToTTAI,
|
|
29
|
+
isPageVisible,
|
|
29
30
|
shouldReportVCMetrics,
|
|
30
31
|
observer,
|
|
31
32
|
isSSREnabled,
|
|
@@ -56,14 +57,15 @@ function _getVCMetrics() {
|
|
|
56
57
|
case 7:
|
|
57
58
|
interactionStatus = (0, _getInteractionStatus.default)(interaction);
|
|
58
59
|
pageVisibilityUpToTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
59
|
-
|
|
60
|
+
isPageVisible = pageVisibilityUpToTTAI === 'visible';
|
|
61
|
+
shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && isPageVisible; // Use per-interaction VC observer if available, otherwise fall back to global
|
|
60
62
|
observer = interaction.vcObserver;
|
|
61
63
|
if (observer) {
|
|
62
|
-
_context.next =
|
|
64
|
+
_context.next = 14;
|
|
63
65
|
break;
|
|
64
66
|
}
|
|
65
67
|
return _context.abrupt("return", {});
|
|
66
|
-
case
|
|
68
|
+
case 14:
|
|
67
69
|
isSSREnabled = interaction.type === 'page_load' && ((config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName)));
|
|
68
70
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
69
71
|
ssr: (0, _getSsrDoneTimeValue.default)(config)
|
|
@@ -71,7 +73,7 @@ function _getVCMetrics() {
|
|
|
71
73
|
_interactionMetrics.postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
72
74
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
73
75
|
prefix = 'ufo';
|
|
74
|
-
_context.next =
|
|
76
|
+
_context.next = 21;
|
|
75
77
|
return observer.getVCResult(_objectSpread(_objectSpread({
|
|
76
78
|
start: interaction.start,
|
|
77
79
|
stop: interaction.end,
|
|
@@ -85,9 +87,11 @@ function _getVCMetrics() {
|
|
|
85
87
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
86
88
|
}, ssr), {}, {
|
|
87
89
|
include3p: include3p,
|
|
88
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
90
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
91
|
+
interactionType: interaction.type,
|
|
92
|
+
isPageVisible: isPageVisible
|
|
89
93
|
}));
|
|
90
|
-
case
|
|
94
|
+
case 21:
|
|
91
95
|
result = _context.sent;
|
|
92
96
|
observer.stop(interaction.ufoName);
|
|
93
97
|
if (!include3p) {
|
|
@@ -100,15 +104,15 @@ function _getVCMetrics() {
|
|
|
100
104
|
return revision === mostRecentVCRevision;
|
|
101
105
|
});
|
|
102
106
|
if (!(!shouldReportVCMetrics || !(mostRecentVCRevisionPayload !== null && mostRecentVCRevisionPayload !== void 0 && mostRecentVCRevisionPayload.clean))) {
|
|
103
|
-
_context.next =
|
|
107
|
+
_context.next = 28;
|
|
104
108
|
break;
|
|
105
109
|
}
|
|
106
110
|
return _context.abrupt("return", result);
|
|
107
|
-
case
|
|
111
|
+
case 28:
|
|
108
112
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
109
113
|
'metric:vc90': mostRecentVCRevisionPayload['metric:vc90']
|
|
110
114
|
}));
|
|
111
|
-
case
|
|
115
|
+
case 29:
|
|
112
116
|
case "end":
|
|
113
117
|
return _context.stop();
|
|
114
118
|
}
|
|
@@ -12,6 +12,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
14
|
var _config = require("../config");
|
|
15
|
+
var _hiddenTiming = require("../hidden-timing");
|
|
15
16
|
var _vc = require("../vc");
|
|
16
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -122,7 +123,7 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
122
123
|
value: (function () {
|
|
123
124
|
var _sendPostInteractionLog = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
124
125
|
var _this$vcObserver4, _config$vc, _config$vc2, _this$vcObserver5;
|
|
125
|
-
var _this$vcObserver3, config, postInteractionFinishVCResult;
|
|
126
|
+
var _this$vcObserver3, pageVisibilityState, isPageVisible, config, postInteractionFinishVCResult;
|
|
126
127
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
127
128
|
while (1) switch (_context.prev = _context.next) {
|
|
128
129
|
case 0:
|
|
@@ -134,9 +135,11 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
134
135
|
(_this$vcObserver3 = this.vcObserver) === null || _this$vcObserver3 === void 0 || _this$vcObserver3.stop();
|
|
135
136
|
return _context.abrupt("return");
|
|
136
137
|
case 4:
|
|
138
|
+
pageVisibilityState = (0, _hiddenTiming.getPageVisibilityState)(this.lastInteractionFinish.start, this.lastInteractionFinish.end);
|
|
139
|
+
isPageVisible = pageVisibilityState === 'visible';
|
|
137
140
|
config = (0, _config.getConfig)();
|
|
138
|
-
_context.next =
|
|
139
|
-
return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread({
|
|
141
|
+
_context.next = 9;
|
|
142
|
+
return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread(_objectSpread({
|
|
140
143
|
start: this.lastInteractionFinish.start,
|
|
141
144
|
stop: performance.now(),
|
|
142
145
|
tti: -1,
|
|
@@ -147,8 +150,12 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
147
150
|
interactionId: this.lastInteractionFinish.id,
|
|
148
151
|
includeSSRInV3: config === null || config === void 0 || (_config$vc = config.vc) === null || _config$vc === void 0 ? void 0 : _config$vc.includeSSRInV3,
|
|
149
152
|
includeSSRRatio: config === null || config === void 0 || (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio
|
|
150
|
-
}, this.vcObserverSSRConfig)
|
|
151
|
-
|
|
153
|
+
}, this.vcObserverSSRConfig), {}, {
|
|
154
|
+
interactionType: this.lastInteractionFinish.type,
|
|
155
|
+
isPageVisible: isPageVisible,
|
|
156
|
+
interactionAbortReason: this.lastInteractionFinish.abortReason
|
|
157
|
+
}));
|
|
158
|
+
case 9:
|
|
152
159
|
postInteractionFinishVCResult = _context.sent;
|
|
153
160
|
(_this$vcObserver5 = this.vcObserver) === null || _this$vcObserver5 === void 0 || _this$vcObserver5.stop();
|
|
154
161
|
this.sinkHandlerFn({
|
|
@@ -158,7 +165,7 @@ var PostInteractionLog = exports.default = /*#__PURE__*/function () {
|
|
|
158
165
|
lastInteractionFinishVCResult: this.lastInteractionFinishVCResult
|
|
159
166
|
});
|
|
160
167
|
this.reset();
|
|
161
|
-
case
|
|
168
|
+
case 13:
|
|
162
169
|
case "end":
|
|
163
170
|
return _context.stop();
|
|
164
171
|
}
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -152,7 +152,10 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
152
152
|
interactionId: param.interactionId,
|
|
153
153
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
154
154
|
include3p: include3p,
|
|
155
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
155
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
156
|
+
interactionType: param.interactionType,
|
|
157
|
+
isPageVisible: param.isPageVisible,
|
|
158
|
+
interactionAbortReason: param.interactionAbortReason
|
|
156
159
|
});
|
|
157
160
|
case 12:
|
|
158
161
|
_context.t1 = _context.sent;
|
|
@@ -238,11 +238,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
238
238
|
key: "getVCResult",
|
|
239
239
|
value: function () {
|
|
240
240
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
241
|
-
var start, stop, interactionId, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
241
|
+
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
242
242
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
243
243
|
while (1) switch (_context.prev = _context.next) {
|
|
244
244
|
case 0:
|
|
245
|
-
start = param.start, stop = param.stop, interactionId = param.interactionId, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
245
|
+
start = param.start, stop = param.stop, interactionId = param.interactionId, interactionType = param.interactionType, interactionAbortReason = param.interactionAbortReason, isPageVisible = param.isPageVisible, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
246
246
|
results = [];
|
|
247
247
|
this.addStartEntry(start);
|
|
248
248
|
calculator_fy25_03 = new _fy25_.default();
|
|
@@ -259,9 +259,12 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
259
259
|
startTime: start,
|
|
260
260
|
stopTime: stop,
|
|
261
261
|
interactionId: interactionId,
|
|
262
|
+
interactionType: interactionType,
|
|
262
263
|
isPostInteraction: this.isPostInteraction,
|
|
263
264
|
include3p: include3p,
|
|
264
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
265
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
266
|
+
isPageVisible: isPageVisible,
|
|
267
|
+
interactionAbortReason: interactionAbortReason
|
|
265
268
|
});
|
|
266
269
|
case 8:
|
|
267
270
|
fy25_03 = _context.sent;
|
|
@@ -281,8 +284,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
281
284
|
startTime: start,
|
|
282
285
|
stopTime: stop,
|
|
283
286
|
interactionId: interactionId,
|
|
287
|
+
interactionType: interactionType,
|
|
284
288
|
isPostInteraction: this.isPostInteraction,
|
|
285
|
-
include3p: include3p
|
|
289
|
+
include3p: include3p,
|
|
290
|
+
isPageVisible: isPageVisible,
|
|
291
|
+
interactionAbortReason: interactionAbortReason
|
|
286
292
|
});
|
|
287
293
|
case 14:
|
|
288
294
|
vcNext = _context.sent;
|
|
@@ -13,9 +13,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
14
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
-
var _getPageVisibilityUpToTtai = _interopRequireDefault(require("../../../create-payload/utils/get-page-visibility-up-to-ttai"));
|
|
17
|
-
var _interactionIdContext = require("../../../interaction-id-context");
|
|
18
|
-
var _constants = require("../../../interaction-metrics/common/constants");
|
|
19
16
|
var _trackDisplayContentOccurrence = require("../viewport-observer/utils/track-display-content-occurrence");
|
|
20
17
|
var _percentileCalc = require("./percentile-calc");
|
|
21
18
|
var _getViewportHeight = _interopRequireDefault(require("./utils/get-viewport-height"));
|
|
@@ -111,9 +108,9 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
111
108
|
}, {
|
|
112
109
|
key: "calculateWithDebugInfo",
|
|
113
110
|
value: function () {
|
|
114
|
-
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch) {
|
|
111
|
+
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason) {
|
|
115
112
|
var _window, _window2, _window6, _window8;
|
|
116
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails,
|
|
113
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
|
|
117
114
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
118
115
|
while (1) switch (_context.prev = _context.next) {
|
|
119
116
|
case 0:
|
|
@@ -314,17 +311,13 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
314
311
|
v3RevisionDebugDetails = null;
|
|
315
312
|
if (shouldCalculateDebugDetails) {
|
|
316
313
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_unify_abort_status_in_ttvc_debug_data')) {
|
|
317
|
-
// NOTE: using this instead of directly calling `getActiveInteraction()` to get around circular dependencies
|
|
318
|
-
activeInteractionId = (0, _interactionIdContext.getInteractionId)();
|
|
319
|
-
activeInteraction = _constants.interactions.get((_activeInteractionId$ = activeInteractionId.current) !== null && _activeInteractionId$ !== void 0 ? _activeInteractionId$ : '');
|
|
320
|
-
pageVisibilityUpToTTAI = activeInteraction ? (0, _getPageVisibilityUpToTtai.default)(activeInteraction) : null;
|
|
321
|
-
isBackgrounded = pageVisibilityUpToTTAI !== 'visible';
|
|
322
314
|
v3RevisionDebugDetails = {
|
|
323
315
|
revision: this.revisionNo,
|
|
324
|
-
isClean: isVCClean && !
|
|
325
|
-
abortReason:
|
|
316
|
+
isClean: isVCClean && !interactionAbortReason && isPageVisible,
|
|
317
|
+
abortReason: !isPageVisible ? 'browser_backgrounded' : dirtyReason !== null && dirtyReason !== void 0 ? dirtyReason : interactionAbortReason,
|
|
326
318
|
vcLogs: enhancedVcLogs,
|
|
327
|
-
interactionId: interactionId
|
|
319
|
+
interactionId: interactionId,
|
|
320
|
+
interactionType: interactionType
|
|
328
321
|
};
|
|
329
322
|
} else {
|
|
330
323
|
v3RevisionDebugDetails = {
|
|
@@ -371,7 +364,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
371
364
|
}
|
|
372
365
|
}, _callee, this, [[10, 22, 25, 28]]);
|
|
373
366
|
}));
|
|
374
|
-
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0) {
|
|
367
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11) {
|
|
375
368
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
376
369
|
}
|
|
377
370
|
return calculateWithDebugInfo;
|
|
@@ -383,11 +376,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
383
376
|
var _this = this,
|
|
384
377
|
_vcDetails$90$t,
|
|
385
378
|
_vcDetails$;
|
|
386
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
379
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, interactionType, isPageVisible, interactionAbortReason, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
387
380
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
388
381
|
while (1) switch (_context2.prev = _context2.next) {
|
|
389
382
|
case 0:
|
|
390
|
-
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch;
|
|
383
|
+
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch, interactionType = _ref.interactionType, isPageVisible = _ref.isPageVisible, interactionAbortReason = _ref.interactionAbortReason;
|
|
391
384
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
392
385
|
return _this.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
|
|
393
386
|
});
|
|
@@ -407,7 +400,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
407
400
|
});
|
|
408
401
|
case 7:
|
|
409
402
|
_context2.next = 9;
|
|
410
|
-
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch);
|
|
403
|
+
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason);
|
|
411
404
|
case 9:
|
|
412
405
|
vcDetails = _context2.sent;
|
|
413
406
|
result = {
|
|
@@ -430,7 +423,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
430
423
|
}
|
|
431
424
|
}, _callee2, this);
|
|
432
425
|
}));
|
|
433
|
-
function calculate(
|
|
426
|
+
function calculate(_x12) {
|
|
434
427
|
return _calculate.apply(this, arguments);
|
|
435
428
|
}
|
|
436
429
|
return calculate;
|
|
@@ -60,6 +60,7 @@ export const experimentalVC = new ExperimentalVCMetrics();
|
|
|
60
60
|
export async function getExperimentalVCMetrics(interaction) {
|
|
61
61
|
// Use per-interaction VC observer if available, otherwise fall back to global experimentalVC
|
|
62
62
|
const vcObserver = interaction.experimentalVCObserver || experimentalVC.vcObserver;
|
|
63
|
+
const pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
|
|
63
64
|
if (vcObserver) {
|
|
64
65
|
var _interaction$apdex, _interaction$apdex$;
|
|
65
66
|
const prefix = 'ufo-experimental';
|
|
@@ -71,13 +72,15 @@ export async function getExperimentalVCMetrics(interaction) {
|
|
|
71
72
|
prefix,
|
|
72
73
|
vc: interaction.vc,
|
|
73
74
|
experienceKey: interaction.ufoName,
|
|
74
|
-
interactionId: interaction.id
|
|
75
|
+
interactionId: interaction.id,
|
|
76
|
+
interactionType: interaction.type,
|
|
77
|
+
isPageVisible: pageVisibilityUpToTTAI === 'visible',
|
|
78
|
+
interactionAbortReason: interaction.abortReason
|
|
75
79
|
});
|
|
76
80
|
const VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
77
81
|
if (!VC || !(result !== null && result !== void 0 && result[`${prefix}:vc:clean`])) {
|
|
78
82
|
return result;
|
|
79
83
|
}
|
|
80
|
-
const pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
|
|
81
84
|
if (interaction.abortReason || pageVisibilityUpToTTAI !== 'visible') {
|
|
82
85
|
return result;
|
|
83
86
|
}
|
|
@@ -14,7 +14,8 @@ async function getVCMetrics(interaction, include3p = false, excludeSmartAnswersI
|
|
|
14
14
|
}
|
|
15
15
|
const interactionStatus = getInteractionStatus(interaction);
|
|
16
16
|
const pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
17
|
-
const
|
|
17
|
+
const isPageVisible = pageVisibilityUpToTTAI === 'visible';
|
|
18
|
+
const shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && isPageVisible;
|
|
18
19
|
|
|
19
20
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
20
21
|
const observer = interaction.vcObserver;
|
|
@@ -41,7 +42,9 @@ async function getVCMetrics(interaction, include3p = false, excludeSmartAnswersI
|
|
|
41
42
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio,
|
|
42
43
|
...ssr,
|
|
43
44
|
include3p,
|
|
44
|
-
excludeSmartAnswersInSearch
|
|
45
|
+
excludeSmartAnswersInSearch,
|
|
46
|
+
interactionType: interaction.type,
|
|
47
|
+
isPageVisible
|
|
45
48
|
});
|
|
46
49
|
observer.stop(interaction.ufoName);
|
|
47
50
|
if (!include3p) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { getConfig } from '../config';
|
|
4
|
+
import { getPageVisibilityState } from '../hidden-timing';
|
|
4
5
|
import { VCObserverWrapper } from '../vc';
|
|
5
6
|
const POST_INTERACTION_LOG_SEND_DEFAULT_TIMEOUT = 3000;
|
|
6
7
|
export default class PostInteractionLog {
|
|
@@ -96,6 +97,8 @@ export default class PostInteractionLog {
|
|
|
96
97
|
(_this$vcObserver3 = this.vcObserver) === null || _this$vcObserver3 === void 0 ? void 0 : _this$vcObserver3.stop();
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
100
|
+
const pageVisibilityState = getPageVisibilityState(this.lastInteractionFinish.start, this.lastInteractionFinish.end);
|
|
101
|
+
const isPageVisible = pageVisibilityState === 'visible';
|
|
99
102
|
const config = getConfig();
|
|
100
103
|
const postInteractionFinishVCResult = await ((_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult({
|
|
101
104
|
start: this.lastInteractionFinish.start,
|
|
@@ -108,7 +111,10 @@ export default class PostInteractionLog {
|
|
|
108
111
|
interactionId: this.lastInteractionFinish.id,
|
|
109
112
|
includeSSRInV3: config === null || config === void 0 ? void 0 : (_config$vc = config.vc) === null || _config$vc === void 0 ? void 0 : _config$vc.includeSSRInV3,
|
|
110
113
|
includeSSRRatio: config === null || config === void 0 ? void 0 : (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio,
|
|
111
|
-
...this.vcObserverSSRConfig
|
|
114
|
+
...this.vcObserverSSRConfig,
|
|
115
|
+
interactionType: this.lastInteractionFinish.type,
|
|
116
|
+
isPageVisible,
|
|
117
|
+
interactionAbortReason: this.lastInteractionFinish.abortReason
|
|
112
118
|
}));
|
|
113
119
|
(_this$vcObserver5 = this.vcObserver) === null || _this$vcObserver5 === void 0 ? void 0 : _this$vcObserver5.stop();
|
|
114
120
|
this.sinkHandlerFn({
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -105,7 +105,10 @@ export class VCObserverWrapper {
|
|
|
105
105
|
interactionId: param.interactionId,
|
|
106
106
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
107
107
|
include3p,
|
|
108
|
-
excludeSmartAnswersInSearch
|
|
108
|
+
excludeSmartAnswersInSearch,
|
|
109
|
+
interactionType: param.interactionType,
|
|
110
|
+
isPageVisible: param.isPageVisible,
|
|
111
|
+
interactionAbortReason: param.interactionAbortReason
|
|
109
112
|
})) : [];
|
|
110
113
|
if (!v3Result) {
|
|
111
114
|
return v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {};
|
|
@@ -196,6 +196,9 @@ export default class VCObserverNew {
|
|
|
196
196
|
start,
|
|
197
197
|
stop,
|
|
198
198
|
interactionId,
|
|
199
|
+
interactionType,
|
|
200
|
+
interactionAbortReason,
|
|
201
|
+
isPageVisible,
|
|
199
202
|
include3p,
|
|
200
203
|
excludeSmartAnswersInSearch
|
|
201
204
|
} = param;
|
|
@@ -214,9 +217,12 @@ export default class VCObserverNew {
|
|
|
214
217
|
startTime: start,
|
|
215
218
|
stopTime: stop,
|
|
216
219
|
interactionId,
|
|
220
|
+
interactionType,
|
|
217
221
|
isPostInteraction: this.isPostInteraction,
|
|
218
222
|
include3p,
|
|
219
|
-
excludeSmartAnswersInSearch
|
|
223
|
+
excludeSmartAnswersInSearch,
|
|
224
|
+
isPageVisible,
|
|
225
|
+
interactionAbortReason
|
|
220
226
|
});
|
|
221
227
|
if (fy25_03) {
|
|
222
228
|
results.push(fy25_03);
|
|
@@ -230,8 +236,11 @@ export default class VCObserverNew {
|
|
|
230
236
|
startTime: start,
|
|
231
237
|
stopTime: stop,
|
|
232
238
|
interactionId,
|
|
239
|
+
interactionType,
|
|
233
240
|
isPostInteraction: this.isPostInteraction,
|
|
234
|
-
include3p
|
|
241
|
+
include3p,
|
|
242
|
+
isPageVisible,
|
|
243
|
+
interactionAbortReason
|
|
235
244
|
});
|
|
236
245
|
if (vcNext) {
|
|
237
246
|
results.push(vcNext);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import getPageVisibilityUpToTTAI from '../../../create-payload/utils/get-page-visibility-up-to-ttai';
|
|
3
|
-
import { getInteractionId } from '../../../interaction-id-context';
|
|
4
|
-
import { interactions } from '../../../interaction-metrics/common/constants';
|
|
5
2
|
import { cssIssueOccurrence } from '../viewport-observer/utils/track-display-content-occurrence';
|
|
6
3
|
import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
|
|
7
4
|
import getViewportHeight from './utils/get-viewport-height';
|
|
@@ -55,7 +52,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
55
52
|
}
|
|
56
53
|
return labelStacks;
|
|
57
54
|
}
|
|
58
|
-
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch) {
|
|
55
|
+
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason) {
|
|
59
56
|
var _window, _window2, _window6, _window8;
|
|
60
57
|
const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99, 100];
|
|
61
58
|
const viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
@@ -212,18 +209,13 @@ export default class AbstractVCCalculatorBase {
|
|
|
212
209
|
let v3RevisionDebugDetails = null;
|
|
213
210
|
if (shouldCalculateDebugDetails) {
|
|
214
211
|
if (fg('platform_ufo_unify_abort_status_in_ttvc_debug_data')) {
|
|
215
|
-
var _activeInteractionId$;
|
|
216
|
-
// NOTE: using this instead of directly calling `getActiveInteraction()` to get around circular dependencies
|
|
217
|
-
const activeInteractionId = getInteractionId();
|
|
218
|
-
const activeInteraction = interactions.get((_activeInteractionId$ = activeInteractionId.current) !== null && _activeInteractionId$ !== void 0 ? _activeInteractionId$ : '');
|
|
219
|
-
const pageVisibilityUpToTTAI = activeInteraction ? getPageVisibilityUpToTTAI(activeInteraction) : null;
|
|
220
|
-
const isBackgrounded = pageVisibilityUpToTTAI !== 'visible';
|
|
221
212
|
v3RevisionDebugDetails = {
|
|
222
213
|
revision: this.revisionNo,
|
|
223
|
-
isClean: isVCClean && !
|
|
224
|
-
abortReason:
|
|
214
|
+
isClean: isVCClean && !interactionAbortReason && isPageVisible,
|
|
215
|
+
abortReason: !isPageVisible ? 'browser_backgrounded' : dirtyReason !== null && dirtyReason !== void 0 ? dirtyReason : interactionAbortReason,
|
|
225
216
|
vcLogs: enhancedVcLogs,
|
|
226
|
-
interactionId
|
|
217
|
+
interactionId,
|
|
218
|
+
interactionType
|
|
227
219
|
};
|
|
228
220
|
} else {
|
|
229
221
|
v3RevisionDebugDetails = {
|
|
@@ -274,7 +266,10 @@ export default class AbstractVCCalculatorBase {
|
|
|
274
266
|
interactionId,
|
|
275
267
|
isPostInteraction,
|
|
276
268
|
include3p,
|
|
277
|
-
excludeSmartAnswersInSearch
|
|
269
|
+
excludeSmartAnswersInSearch,
|
|
270
|
+
interactionType,
|
|
271
|
+
isPageVisible,
|
|
272
|
+
interactionAbortReason
|
|
278
273
|
}) {
|
|
279
274
|
var _vcDetails$90$t, _vcDetails$;
|
|
280
275
|
const filteredEntries = orderedEntries.filter(entry => {
|
|
@@ -294,7 +289,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
294
289
|
abortTimestamp: getVCCleanStatusResult.abortTimestamp
|
|
295
290
|
};
|
|
296
291
|
}
|
|
297
|
-
const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch);
|
|
292
|
+
const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason);
|
|
298
293
|
const result = {
|
|
299
294
|
revision: this.revisionNo,
|
|
300
295
|
clean: true,
|
|
@@ -84,18 +84,19 @@ export function getExperimentalVCMetrics(_x) {
|
|
|
84
84
|
}
|
|
85
85
|
function _getExperimentalVCMetrics() {
|
|
86
86
|
_getExperimentalVCMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interaction) {
|
|
87
|
-
var vcObserver, _interaction$apdex, prefix, result, VC
|
|
87
|
+
var vcObserver, pageVisibilityUpToTTAI, _interaction$apdex, prefix, result, VC;
|
|
88
88
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
89
89
|
while (1) switch (_context.prev = _context.next) {
|
|
90
90
|
case 0:
|
|
91
91
|
// Use per-interaction VC observer if available, otherwise fall back to global experimentalVC
|
|
92
92
|
vcObserver = interaction.experimentalVCObserver || experimentalVC.vcObserver;
|
|
93
|
+
pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
|
|
93
94
|
if (!vcObserver) {
|
|
94
95
|
_context.next = 13;
|
|
95
96
|
break;
|
|
96
97
|
}
|
|
97
98
|
prefix = 'ufo-experimental';
|
|
98
|
-
_context.next =
|
|
99
|
+
_context.next = 6;
|
|
99
100
|
return vcObserver.getVCResult({
|
|
100
101
|
start: interaction.start,
|
|
101
102
|
stop: interaction.end,
|
|
@@ -104,18 +105,20 @@ function _getExperimentalVCMetrics() {
|
|
|
104
105
|
prefix: prefix,
|
|
105
106
|
vc: interaction.vc,
|
|
106
107
|
experienceKey: interaction.ufoName,
|
|
107
|
-
interactionId: interaction.id
|
|
108
|
+
interactionId: interaction.id,
|
|
109
|
+
interactionType: interaction.type,
|
|
110
|
+
isPageVisible: pageVisibilityUpToTTAI === 'visible',
|
|
111
|
+
interactionAbortReason: interaction.abortReason
|
|
108
112
|
});
|
|
109
|
-
case
|
|
113
|
+
case 6:
|
|
110
114
|
result = _context.sent;
|
|
111
115
|
VC = result === null || result === void 0 ? void 0 : result['metrics:vc'];
|
|
112
116
|
if (!(!VC || !(result !== null && result !== void 0 && result["".concat(prefix, ":vc:clean")]))) {
|
|
113
|
-
_context.next =
|
|
117
|
+
_context.next = 10;
|
|
114
118
|
break;
|
|
115
119
|
}
|
|
116
120
|
return _context.abrupt("return", result);
|
|
117
|
-
case
|
|
118
|
-
pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
|
|
121
|
+
case 10:
|
|
119
122
|
if (!(interaction.abortReason || pageVisibilityUpToTTAI !== 'visible')) {
|
|
120
123
|
_context.next = 12;
|
|
121
124
|
break;
|
|
@@ -19,6 +19,7 @@ function _getVCMetrics() {
|
|
|
19
19
|
config,
|
|
20
20
|
interactionStatus,
|
|
21
21
|
pageVisibilityUpToTTAI,
|
|
22
|
+
isPageVisible,
|
|
22
23
|
shouldReportVCMetrics,
|
|
23
24
|
observer,
|
|
24
25
|
isSSREnabled,
|
|
@@ -49,14 +50,15 @@ function _getVCMetrics() {
|
|
|
49
50
|
case 7:
|
|
50
51
|
interactionStatus = getInteractionStatus(interaction);
|
|
51
52
|
pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
52
|
-
|
|
53
|
+
isPageVisible = pageVisibilityUpToTTAI === 'visible';
|
|
54
|
+
shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && isPageVisible; // Use per-interaction VC observer if available, otherwise fall back to global
|
|
53
55
|
observer = interaction.vcObserver;
|
|
54
56
|
if (observer) {
|
|
55
|
-
_context.next =
|
|
57
|
+
_context.next = 14;
|
|
56
58
|
break;
|
|
57
59
|
}
|
|
58
60
|
return _context.abrupt("return", {});
|
|
59
|
-
case
|
|
61
|
+
case 14:
|
|
60
62
|
isSSREnabled = interaction.type === 'page_load' && ((config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName)));
|
|
61
63
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
62
64
|
ssr: getSSRDoneTimeValue(config)
|
|
@@ -64,7 +66,7 @@ function _getVCMetrics() {
|
|
|
64
66
|
postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
65
67
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
66
68
|
prefix = 'ufo';
|
|
67
|
-
_context.next =
|
|
69
|
+
_context.next = 21;
|
|
68
70
|
return observer.getVCResult(_objectSpread(_objectSpread({
|
|
69
71
|
start: interaction.start,
|
|
70
72
|
stop: interaction.end,
|
|
@@ -78,9 +80,11 @@ function _getVCMetrics() {
|
|
|
78
80
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
79
81
|
}, ssr), {}, {
|
|
80
82
|
include3p: include3p,
|
|
81
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
83
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
84
|
+
interactionType: interaction.type,
|
|
85
|
+
isPageVisible: isPageVisible
|
|
82
86
|
}));
|
|
83
|
-
case
|
|
87
|
+
case 21:
|
|
84
88
|
result = _context.sent;
|
|
85
89
|
observer.stop(interaction.ufoName);
|
|
86
90
|
if (!include3p) {
|
|
@@ -93,15 +97,15 @@ function _getVCMetrics() {
|
|
|
93
97
|
return revision === mostRecentVCRevision;
|
|
94
98
|
});
|
|
95
99
|
if (!(!shouldReportVCMetrics || !(mostRecentVCRevisionPayload !== null && mostRecentVCRevisionPayload !== void 0 && mostRecentVCRevisionPayload.clean))) {
|
|
96
|
-
_context.next =
|
|
100
|
+
_context.next = 28;
|
|
97
101
|
break;
|
|
98
102
|
}
|
|
99
103
|
return _context.abrupt("return", result);
|
|
100
|
-
case
|
|
104
|
+
case 28:
|
|
101
105
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
102
106
|
'metric:vc90': mostRecentVCRevisionPayload['metric:vc90']
|
|
103
107
|
}));
|
|
104
|
-
case
|
|
108
|
+
case 29:
|
|
105
109
|
case "end":
|
|
106
110
|
return _context.stop();
|
|
107
111
|
}
|
|
@@ -7,6 +7,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { getConfig } from '../config';
|
|
10
|
+
import { getPageVisibilityState } from '../hidden-timing';
|
|
10
11
|
import { VCObserverWrapper } from '../vc';
|
|
11
12
|
var POST_INTERACTION_LOG_SEND_DEFAULT_TIMEOUT = 3000;
|
|
12
13
|
var PostInteractionLog = /*#__PURE__*/function () {
|
|
@@ -115,7 +116,7 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
115
116
|
value: (function () {
|
|
116
117
|
var _sendPostInteractionLog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
117
118
|
var _this$vcObserver4, _config$vc, _config$vc2, _this$vcObserver5;
|
|
118
|
-
var _this$vcObserver3, config, postInteractionFinishVCResult;
|
|
119
|
+
var _this$vcObserver3, pageVisibilityState, isPageVisible, config, postInteractionFinishVCResult;
|
|
119
120
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
120
121
|
while (1) switch (_context.prev = _context.next) {
|
|
121
122
|
case 0:
|
|
@@ -127,9 +128,11 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
127
128
|
(_this$vcObserver3 = this.vcObserver) === null || _this$vcObserver3 === void 0 || _this$vcObserver3.stop();
|
|
128
129
|
return _context.abrupt("return");
|
|
129
130
|
case 4:
|
|
131
|
+
pageVisibilityState = getPageVisibilityState(this.lastInteractionFinish.start, this.lastInteractionFinish.end);
|
|
132
|
+
isPageVisible = pageVisibilityState === 'visible';
|
|
130
133
|
config = getConfig();
|
|
131
|
-
_context.next =
|
|
132
|
-
return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread({
|
|
134
|
+
_context.next = 9;
|
|
135
|
+
return (_this$vcObserver4 = this.vcObserver) === null || _this$vcObserver4 === void 0 ? void 0 : _this$vcObserver4.getVCResult(_objectSpread(_objectSpread({
|
|
133
136
|
start: this.lastInteractionFinish.start,
|
|
134
137
|
stop: performance.now(),
|
|
135
138
|
tti: -1,
|
|
@@ -140,8 +143,12 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
140
143
|
interactionId: this.lastInteractionFinish.id,
|
|
141
144
|
includeSSRInV3: config === null || config === void 0 || (_config$vc = config.vc) === null || _config$vc === void 0 ? void 0 : _config$vc.includeSSRInV3,
|
|
142
145
|
includeSSRRatio: config === null || config === void 0 || (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio
|
|
143
|
-
}, this.vcObserverSSRConfig)
|
|
144
|
-
|
|
146
|
+
}, this.vcObserverSSRConfig), {}, {
|
|
147
|
+
interactionType: this.lastInteractionFinish.type,
|
|
148
|
+
isPageVisible: isPageVisible,
|
|
149
|
+
interactionAbortReason: this.lastInteractionFinish.abortReason
|
|
150
|
+
}));
|
|
151
|
+
case 9:
|
|
145
152
|
postInteractionFinishVCResult = _context.sent;
|
|
146
153
|
(_this$vcObserver5 = this.vcObserver) === null || _this$vcObserver5 === void 0 || _this$vcObserver5.stop();
|
|
147
154
|
this.sinkHandlerFn({
|
|
@@ -151,7 +158,7 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
151
158
|
lastInteractionFinishVCResult: this.lastInteractionFinishVCResult
|
|
152
159
|
});
|
|
153
160
|
this.reset();
|
|
154
|
-
case
|
|
161
|
+
case 13:
|
|
155
162
|
case "end":
|
|
156
163
|
return _context.stop();
|
|
157
164
|
}
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -142,7 +142,10 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
142
142
|
interactionId: param.interactionId,
|
|
143
143
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
144
144
|
include3p: include3p,
|
|
145
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
145
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
146
|
+
interactionType: param.interactionType,
|
|
147
|
+
isPageVisible: param.isPageVisible,
|
|
148
|
+
interactionAbortReason: param.interactionAbortReason
|
|
146
149
|
});
|
|
147
150
|
case 12:
|
|
148
151
|
_context.t1 = _context.sent;
|
|
@@ -231,11 +231,11 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
231
231
|
key: "getVCResult",
|
|
232
232
|
value: function () {
|
|
233
233
|
var _getVCResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
|
|
234
|
-
var start, stop, interactionId, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
234
|
+
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
235
235
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
236
236
|
while (1) switch (_context.prev = _context.next) {
|
|
237
237
|
case 0:
|
|
238
|
-
start = param.start, stop = param.stop, interactionId = param.interactionId, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
238
|
+
start = param.start, stop = param.stop, interactionId = param.interactionId, interactionType = param.interactionType, interactionAbortReason = param.interactionAbortReason, isPageVisible = param.isPageVisible, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
239
239
|
results = [];
|
|
240
240
|
this.addStartEntry(start);
|
|
241
241
|
calculator_fy25_03 = new VCCalculator_FY25_03();
|
|
@@ -252,9 +252,12 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
252
252
|
startTime: start,
|
|
253
253
|
stopTime: stop,
|
|
254
254
|
interactionId: interactionId,
|
|
255
|
+
interactionType: interactionType,
|
|
255
256
|
isPostInteraction: this.isPostInteraction,
|
|
256
257
|
include3p: include3p,
|
|
257
|
-
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
258
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
259
|
+
isPageVisible: isPageVisible,
|
|
260
|
+
interactionAbortReason: interactionAbortReason
|
|
258
261
|
});
|
|
259
262
|
case 8:
|
|
260
263
|
fy25_03 = _context.sent;
|
|
@@ -274,8 +277,11 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
274
277
|
startTime: start,
|
|
275
278
|
stopTime: stop,
|
|
276
279
|
interactionId: interactionId,
|
|
280
|
+
interactionType: interactionType,
|
|
277
281
|
isPostInteraction: this.isPostInteraction,
|
|
278
|
-
include3p: include3p
|
|
282
|
+
include3p: include3p,
|
|
283
|
+
isPageVisible: isPageVisible,
|
|
284
|
+
interactionAbortReason: interactionAbortReason
|
|
279
285
|
});
|
|
280
286
|
case 14:
|
|
281
287
|
vcNext = _context.sent;
|
|
@@ -11,9 +11,6 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
11
11
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
12
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
-
import getPageVisibilityUpToTTAI from '../../../create-payload/utils/get-page-visibility-up-to-ttai';
|
|
15
|
-
import { getInteractionId } from '../../../interaction-id-context';
|
|
16
|
-
import { interactions } from '../../../interaction-metrics/common/constants';
|
|
17
14
|
import { cssIssueOccurrence } from '../viewport-observer/utils/track-display-content-occurrence';
|
|
18
15
|
import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
|
|
19
16
|
import getViewportHeight from './utils/get-viewport-height';
|
|
@@ -105,9 +102,9 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
105
102
|
}, {
|
|
106
103
|
key: "calculateWithDebugInfo",
|
|
107
104
|
value: function () {
|
|
108
|
-
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch) {
|
|
105
|
+
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason) {
|
|
109
106
|
var _window, _window2, _window6, _window8;
|
|
110
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails,
|
|
107
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
|
|
111
108
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
112
109
|
while (1) switch (_context.prev = _context.next) {
|
|
113
110
|
case 0:
|
|
@@ -308,17 +305,13 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
308
305
|
v3RevisionDebugDetails = null;
|
|
309
306
|
if (shouldCalculateDebugDetails) {
|
|
310
307
|
if (fg('platform_ufo_unify_abort_status_in_ttvc_debug_data')) {
|
|
311
|
-
// NOTE: using this instead of directly calling `getActiveInteraction()` to get around circular dependencies
|
|
312
|
-
activeInteractionId = getInteractionId();
|
|
313
|
-
activeInteraction = interactions.get((_activeInteractionId$ = activeInteractionId.current) !== null && _activeInteractionId$ !== void 0 ? _activeInteractionId$ : '');
|
|
314
|
-
pageVisibilityUpToTTAI = activeInteraction ? getPageVisibilityUpToTTAI(activeInteraction) : null;
|
|
315
|
-
isBackgrounded = pageVisibilityUpToTTAI !== 'visible';
|
|
316
308
|
v3RevisionDebugDetails = {
|
|
317
309
|
revision: this.revisionNo,
|
|
318
|
-
isClean: isVCClean && !
|
|
319
|
-
abortReason:
|
|
310
|
+
isClean: isVCClean && !interactionAbortReason && isPageVisible,
|
|
311
|
+
abortReason: !isPageVisible ? 'browser_backgrounded' : dirtyReason !== null && dirtyReason !== void 0 ? dirtyReason : interactionAbortReason,
|
|
320
312
|
vcLogs: enhancedVcLogs,
|
|
321
|
-
interactionId: interactionId
|
|
313
|
+
interactionId: interactionId,
|
|
314
|
+
interactionType: interactionType
|
|
322
315
|
};
|
|
323
316
|
} else {
|
|
324
317
|
v3RevisionDebugDetails = {
|
|
@@ -365,7 +358,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
365
358
|
}
|
|
366
359
|
}, _callee, this, [[10, 22, 25, 28]]);
|
|
367
360
|
}));
|
|
368
|
-
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0) {
|
|
361
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11) {
|
|
369
362
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
370
363
|
}
|
|
371
364
|
return calculateWithDebugInfo;
|
|
@@ -377,11 +370,11 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
377
370
|
var _this = this,
|
|
378
371
|
_vcDetails$90$t,
|
|
379
372
|
_vcDetails$;
|
|
380
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
373
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, interactionType, isPageVisible, interactionAbortReason, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
381
374
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
382
375
|
while (1) switch (_context2.prev = _context2.next) {
|
|
383
376
|
case 0:
|
|
384
|
-
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch;
|
|
377
|
+
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch, interactionType = _ref.interactionType, isPageVisible = _ref.isPageVisible, interactionAbortReason = _ref.interactionAbortReason;
|
|
385
378
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
386
379
|
return _this.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
|
|
387
380
|
});
|
|
@@ -401,7 +394,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
401
394
|
});
|
|
402
395
|
case 7:
|
|
403
396
|
_context2.next = 9;
|
|
404
|
-
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch);
|
|
397
|
+
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason);
|
|
405
398
|
case 9:
|
|
406
399
|
vcDetails = _context2.sent;
|
|
407
400
|
result = {
|
|
@@ -424,7 +417,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
424
417
|
}
|
|
425
418
|
}, _callee2, this);
|
|
426
419
|
}));
|
|
427
|
-
function calculate(
|
|
420
|
+
function calculate(_x12) {
|
|
428
421
|
return _calculate.apply(this, arguments);
|
|
429
422
|
}
|
|
430
423
|
return calculate;
|
package/dist/types/vc/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { VCRawDataType, VCResult } from '../common/vc/types';
|
|
2
|
+
import type { AbortReasonType, InteractionType } from '../interaction-metrics';
|
|
2
3
|
export type GetVCResultType = {
|
|
3
4
|
start: number;
|
|
4
5
|
stop: number;
|
|
@@ -13,6 +14,9 @@ export type GetVCResultType = {
|
|
|
13
14
|
includeSSRRatio?: boolean;
|
|
14
15
|
include3p?: boolean;
|
|
15
16
|
excludeSmartAnswersInSearch?: boolean;
|
|
17
|
+
interactionType: InteractionType;
|
|
18
|
+
isPageVisible: boolean;
|
|
19
|
+
interactionAbortReason?: AbortReasonType;
|
|
16
20
|
};
|
|
17
21
|
export type SelectorConfig = {
|
|
18
22
|
id: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InteractionType } from '../../common/common/types';
|
|
1
2
|
import type { ComponentsLogType, VCAbortReason, VCEntryType, VCIgnoreReason } from '../../common/vc/types';
|
|
2
3
|
import type { VCObserverEntryType } from '../vc-observer-new/types';
|
|
3
4
|
export type VCLogEntry = {
|
|
@@ -21,6 +22,7 @@ export interface VCRevisionDebugDetails {
|
|
|
21
22
|
abortTimestamp?: number;
|
|
22
23
|
vcLogs: VCLogEntry[];
|
|
23
24
|
interactionId?: string;
|
|
25
|
+
interactionType?: InteractionType;
|
|
24
26
|
}
|
|
25
27
|
export declare function getVCRevisionDebugDetails({ revision, isClean, abortReason, VCEntries, componentsLog, interactionId, }: {
|
|
26
28
|
revision: string;
|
|
@@ -25,5 +25,5 @@ export default abstract class AbstractVCCalculatorBase implements VCCalculator {
|
|
|
25
25
|
private calculateRatios;
|
|
26
26
|
private getLabelStacks;
|
|
27
27
|
private calculateWithDebugInfo;
|
|
28
|
-
calculate({ startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, }: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
|
|
28
|
+
calculate({ startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, interactionType, isPageVisible, interactionAbortReason, }: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
|
|
29
29
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AbortReasonType, InteractionType } from '../../../common/common/types';
|
|
1
2
|
import type { RevisionPayloadEntry } from '../../../common/vc/types';
|
|
2
3
|
import type { VCObserverEntry } from '../types';
|
|
3
4
|
export type VCCalculatorParam = {
|
|
@@ -8,6 +9,9 @@ export type VCCalculatorParam = {
|
|
|
8
9
|
isPostInteraction: boolean;
|
|
9
10
|
include3p?: boolean;
|
|
10
11
|
excludeSmartAnswersInSearch?: boolean;
|
|
12
|
+
interactionType: InteractionType;
|
|
13
|
+
isPageVisible: boolean;
|
|
14
|
+
interactionAbortReason?: AbortReasonType;
|
|
11
15
|
};
|
|
12
16
|
export interface VCCalculator {
|
|
13
17
|
calculate(param: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AbortReasonType, InteractionType } from '../../common/common/types';
|
|
1
2
|
import type { ObservedWindowEvent } from './window-event-observer';
|
|
2
3
|
export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:display-contents-children-element' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:ssr-placeholder' | 'layout-shift' | 'window:event' | 'ssr-hydration' | 'unknown';
|
|
3
4
|
export type ViewportEntryData = {
|
|
@@ -30,4 +31,7 @@ export type VCObserverGetVCResultParam = {
|
|
|
30
31
|
ssr?: number;
|
|
31
32
|
include3p?: boolean;
|
|
32
33
|
excludeSmartAnswersInSearch?: boolean;
|
|
34
|
+
interactionType: InteractionType;
|
|
35
|
+
isPageVisible: boolean;
|
|
36
|
+
interactionAbortReason?: AbortReasonType;
|
|
33
37
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { VCRawDataType, VCResult } from '../common/vc/types';
|
|
2
|
+
import type { AbortReasonType, InteractionType } from '../interaction-metrics';
|
|
2
3
|
export type GetVCResultType = {
|
|
3
4
|
start: number;
|
|
4
5
|
stop: number;
|
|
@@ -13,6 +14,9 @@ export type GetVCResultType = {
|
|
|
13
14
|
includeSSRRatio?: boolean;
|
|
14
15
|
include3p?: boolean;
|
|
15
16
|
excludeSmartAnswersInSearch?: boolean;
|
|
17
|
+
interactionType: InteractionType;
|
|
18
|
+
isPageVisible: boolean;
|
|
19
|
+
interactionAbortReason?: AbortReasonType;
|
|
16
20
|
};
|
|
17
21
|
export type SelectorConfig = {
|
|
18
22
|
id: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InteractionType } from '../../common/common/types';
|
|
1
2
|
import type { ComponentsLogType, VCAbortReason, VCEntryType, VCIgnoreReason } from '../../common/vc/types';
|
|
2
3
|
import type { VCObserverEntryType } from '../vc-observer-new/types';
|
|
3
4
|
export type VCLogEntry = {
|
|
@@ -21,6 +22,7 @@ export interface VCRevisionDebugDetails {
|
|
|
21
22
|
abortTimestamp?: number;
|
|
22
23
|
vcLogs: VCLogEntry[];
|
|
23
24
|
interactionId?: string;
|
|
25
|
+
interactionType?: InteractionType;
|
|
24
26
|
}
|
|
25
27
|
export declare function getVCRevisionDebugDetails({ revision, isClean, abortReason, VCEntries, componentsLog, interactionId, }: {
|
|
26
28
|
revision: string;
|
package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts
CHANGED
|
@@ -25,5 +25,5 @@ export default abstract class AbstractVCCalculatorBase implements VCCalculator {
|
|
|
25
25
|
private calculateRatios;
|
|
26
26
|
private getLabelStacks;
|
|
27
27
|
private calculateWithDebugInfo;
|
|
28
|
-
calculate({ startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, }: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
|
|
28
|
+
calculate({ startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, interactionType, isPageVisible, interactionAbortReason, }: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
|
|
29
29
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AbortReasonType, InteractionType } from '../../../common/common/types';
|
|
1
2
|
import type { RevisionPayloadEntry } from '../../../common/vc/types';
|
|
2
3
|
import type { VCObserverEntry } from '../types';
|
|
3
4
|
export type VCCalculatorParam = {
|
|
@@ -8,6 +9,9 @@ export type VCCalculatorParam = {
|
|
|
8
9
|
isPostInteraction: boolean;
|
|
9
10
|
include3p?: boolean;
|
|
10
11
|
excludeSmartAnswersInSearch?: boolean;
|
|
12
|
+
interactionType: InteractionType;
|
|
13
|
+
isPageVisible: boolean;
|
|
14
|
+
interactionAbortReason?: AbortReasonType;
|
|
11
15
|
};
|
|
12
16
|
export interface VCCalculator {
|
|
13
17
|
calculate(param: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AbortReasonType, InteractionType } from '../../common/common/types';
|
|
1
2
|
import type { ObservedWindowEvent } from './window-event-observer';
|
|
2
3
|
export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:display-contents-children-element' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:ssr-placeholder' | 'layout-shift' | 'window:event' | 'ssr-hydration' | 'unknown';
|
|
3
4
|
export type ViewportEntryData = {
|
|
@@ -30,4 +31,7 @@ export type VCObserverGetVCResultParam = {
|
|
|
30
31
|
ssr?: number;
|
|
31
32
|
include3p?: boolean;
|
|
32
33
|
excludeSmartAnswersInSearch?: boolean;
|
|
34
|
+
interactionType: InteractionType;
|
|
35
|
+
isPageVisible: boolean;
|
|
36
|
+
interactionAbortReason?: AbortReasonType;
|
|
33
37
|
};
|