@atlaskit/react-ufo 4.4.2 → 4.4.4
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 +18 -0
- package/dist/cjs/create-interaction-extra-metrics-payload/index.js +116 -0
- package/dist/cjs/create-payload/index.js +3 -2
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +37 -21
- package/dist/cjs/interaction-metrics/index.js +306 -232
- package/dist/cjs/interaction-metrics/interaction-extra-metrics.js +89 -0
- package/dist/cjs/interaction-metrics-init/index.js +51 -7
- package/dist/cjs/segment/third-party-segment.js +3 -1
- package/dist/cjs/ssr/index.js +3 -2
- package/dist/cjs/trace-interaction/internal/trace-ufo-interaction.js +3 -8
- package/dist/cjs/vc/index.js +4 -3
- package/dist/cjs/vc/vc-observer/index.js +3 -46
- package/dist/cjs/vc/vc-observer-new/index.js +4 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +3 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +4 -4
- package/dist/es2019/create-interaction-extra-metrics-payload/index.js +93 -0
- package/dist/es2019/create-payload/index.js +3 -3
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +3 -2
- package/dist/es2019/interaction-metrics/index.js +310 -233
- package/dist/es2019/interaction-metrics/interaction-extra-metrics.js +63 -0
- package/dist/es2019/interaction-metrics-init/index.js +29 -2
- package/dist/es2019/segment/third-party-segment.js +3 -1
- package/dist/es2019/ssr/index.js +3 -2
- package/dist/es2019/trace-interaction/internal/trace-ufo-interaction.js +3 -8
- package/dist/es2019/vc/index.js +4 -2
- package/dist/es2019/vc/vc-observer/index.js +0 -43
- package/dist/es2019/vc/vc-observer-new/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +3 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +4 -4
- package/dist/esm/create-interaction-extra-metrics-payload/index.js +109 -0
- package/dist/esm/create-payload/index.js +3 -3
- package/dist/esm/create-payload/utils/get-vc-metrics.js +37 -21
- package/dist/esm/interaction-metrics/index.js +305 -231
- package/dist/esm/interaction-metrics/interaction-extra-metrics.js +83 -0
- package/dist/esm/interaction-metrics-init/index.js +48 -6
- package/dist/esm/segment/third-party-segment.js +3 -1
- package/dist/esm/ssr/index.js +3 -2
- package/dist/esm/trace-interaction/internal/trace-ufo-interaction.js +3 -8
- package/dist/esm/vc/index.js +4 -3
- package/dist/esm/vc/vc-observer/index.js +3 -46
- package/dist/esm/vc/vc-observer-new/index.js +4 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +3 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +4 -4
- package/dist/types/common/common/types.d.ts +2 -0
- package/dist/types/create-interaction-extra-metrics-payload/index.d.ts +45 -0
- package/dist/types/create-payload/index.d.ts +1 -0
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +1 -1
- package/dist/types/interaction-metrics/index.d.ts +2 -0
- package/dist/types/interaction-metrics/interaction-extra-metrics.d.ts +17 -0
- package/dist/types/vc/types.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +2 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/types.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +1 -0
- package/dist/types-ts4.5/common/common/types.d.ts +2 -0
- package/dist/types-ts4.5/create-interaction-extra-metrics-payload/index.d.ts +45 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +1 -0
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +1 -1
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +2 -0
- package/dist/types-ts4.5/interaction-metrics/interaction-extra-metrics.d.ts +17 -0
- package/dist/types-ts4.5/vc/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +1 -0
- package/package.json +4 -10
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _vc = require("../vc");
|
|
12
|
+
var _constants = require("./common/constants");
|
|
13
|
+
var _index = require("./index");
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
var InteractionExtraMetrics = exports.default = /*#__PURE__*/function () {
|
|
17
|
+
function InteractionExtraMetrics() {
|
|
18
|
+
(0, _classCallCheck2.default)(this, InteractionExtraMetrics);
|
|
19
|
+
// Store the finished interaction ID (as non-3p interaction)
|
|
20
|
+
(0, _defineProperty2.default)(this, "finishedInteractionId", null);
|
|
21
|
+
// independent VC observer, that observes until `custom.post-interaction-logs` event is sent
|
|
22
|
+
(0, _defineProperty2.default)(this, "vcObserver", null);
|
|
23
|
+
(0, _defineProperty2.default)(this, "sinkHandlerFn", function () {});
|
|
24
|
+
}
|
|
25
|
+
return (0, _createClass2.default)(InteractionExtraMetrics, [{
|
|
26
|
+
key: "initializeVCObserver",
|
|
27
|
+
value: function initializeVCObserver(options) {
|
|
28
|
+
this.vcObserver = new _vc.VCObserverWrapper(_objectSpread(_objectSpread({}, options), {}, {
|
|
29
|
+
isPostInteraction: true
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
key: "startVCObserver",
|
|
34
|
+
value: function startVCObserver(_ref, interactionId) {
|
|
35
|
+
var startTime = _ref.startTime;
|
|
36
|
+
if (this.eligibleToMeasure(interactionId)) {
|
|
37
|
+
var _this$vcObserver;
|
|
38
|
+
(_this$vcObserver = this.vcObserver) === null || _this$vcObserver === void 0 || _this$vcObserver.start({
|
|
39
|
+
startTime: startTime
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
key: "stopVCObserver",
|
|
45
|
+
value: function stopVCObserver() {
|
|
46
|
+
var _this$vcObserver2;
|
|
47
|
+
(_this$vcObserver2 = this.vcObserver) === null || _this$vcObserver2 === void 0 || _this$vcObserver2.stop();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Check if the current interaction is eligible for measurement
|
|
51
|
+
}, {
|
|
52
|
+
key: "eligibleToMeasure",
|
|
53
|
+
value: function eligibleToMeasure(interactionId) {
|
|
54
|
+
var interaction = _constants.interactions.get(interactionId);
|
|
55
|
+
return (interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'page_load' || (interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'transition';
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "updateFinishedInteractionId",
|
|
59
|
+
value: function updateFinishedInteractionId(interactionId) {
|
|
60
|
+
if (this.eligibleToMeasure(interactionId)) {
|
|
61
|
+
this.finishedInteractionId = interactionId;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "sinkHandler",
|
|
66
|
+
value: function sinkHandler(fn) {
|
|
67
|
+
this.sinkHandlerFn = fn;
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "onInteractionComplete",
|
|
71
|
+
value: function onInteractionComplete(id, data) {
|
|
72
|
+
if (data.ufoName) {
|
|
73
|
+
var _this$vcObserver3;
|
|
74
|
+
var updatedData = _objectSpread(_objectSpread({}, data), {}, {
|
|
75
|
+
vcObserver: (_this$vcObserver3 = this.vcObserver) !== null && _this$vcObserver3 !== void 0 ? _this$vcObserver3 : undefined
|
|
76
|
+
});
|
|
77
|
+
this.sinkHandlerFn(id, updatedData);
|
|
78
|
+
}
|
|
79
|
+
this.stopVCObserver();
|
|
80
|
+
(0, _index.remove)(id);
|
|
81
|
+
this.reset();
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "reset",
|
|
85
|
+
value: function reset() {
|
|
86
|
+
this.finishedInteractionId = null;
|
|
87
|
+
}
|
|
88
|
+
}]);
|
|
89
|
+
}();
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.init = init;
|
|
8
|
-
var
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
13
|
var _additionalPayload = require("../additional-payload");
|
|
12
14
|
var _config = require("../config");
|
|
@@ -16,7 +18,7 @@ var _interactionMetrics = require("../interaction-metrics");
|
|
|
16
18
|
var _interactionsPerformanceObserver = require("../interactions-performance-observer");
|
|
17
19
|
var _machineUtilisation = require("../machine-utilisation");
|
|
18
20
|
var _scheduleIdleCallback = _interopRequireDefault(require("./schedule-idle-callback"));
|
|
19
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (
|
|
21
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
22
|
var initialized = false;
|
|
21
23
|
function sinkInteraction(instance, payloadPackage) {
|
|
22
24
|
function sinkFn(interactionId, interaction) {
|
|
@@ -78,6 +80,36 @@ function sinkPostInteractionLog(instance, createPostInteractionLogPayload) {
|
|
|
78
80
|
});
|
|
79
81
|
});
|
|
80
82
|
}
|
|
83
|
+
function sinkInteractionExtraMetrics(instance, createInteractionExtraLogPayload) {
|
|
84
|
+
_interactionMetrics.interactionExtraMetrics.sinkHandler(function (interactionId, interaction) {
|
|
85
|
+
(0, _scheduleIdleCallback.default)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
86
|
+
var payload, devToolObserver;
|
|
87
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
88
|
+
while (1) switch (_context.prev = _context.next) {
|
|
89
|
+
case 0:
|
|
90
|
+
_context.next = 2;
|
|
91
|
+
return createInteractionExtraLogPayload(interactionId, interaction);
|
|
92
|
+
case 2:
|
|
93
|
+
payload = _context.sent;
|
|
94
|
+
if (payload) {
|
|
95
|
+
// NOTE: This API is used by the UFO DevTool Chrome Extension and also by Criterion
|
|
96
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
97
|
+
if ((0, _platformFeatureFlags.fg)('enable_ufo_devtools_api_for_extra_events')) {
|
|
98
|
+
devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
|
|
99
|
+
if (typeof devToolObserver === 'function') {
|
|
100
|
+
devToolObserver === null || devToolObserver === void 0 || devToolObserver(payload);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
instance.sendOperationalEvent(payload);
|
|
104
|
+
}
|
|
105
|
+
case 4:
|
|
106
|
+
case "end":
|
|
107
|
+
return _context.stop();
|
|
108
|
+
}
|
|
109
|
+
}, _callee);
|
|
110
|
+
})));
|
|
111
|
+
});
|
|
112
|
+
}
|
|
81
113
|
function init(analyticsWebClientAsync, config) {
|
|
82
114
|
var _config$vc;
|
|
83
115
|
if (initialized) {
|
|
@@ -103,6 +135,9 @@ function init(analyticsWebClientAsync, config) {
|
|
|
103
135
|
startTime: 0
|
|
104
136
|
});
|
|
105
137
|
}
|
|
138
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
|
|
139
|
+
_interactionMetrics.interactionExtraMetrics.initializeVCObserver(vcOptions);
|
|
140
|
+
}
|
|
106
141
|
}
|
|
107
142
|
(0, _hiddenTiming.setupHiddenTimingCapture)();
|
|
108
143
|
(0, _additionalPayload.startLighthouseObserver)();
|
|
@@ -119,11 +154,14 @@ function init(analyticsWebClientAsync, config) {
|
|
|
119
154
|
return _interopRequireWildcard(require( /* webpackChunkName: "create-payloads" */'../create-payload'));
|
|
120
155
|
}), Promise.resolve().then(function () {
|
|
121
156
|
return _interopRequireWildcard(require( /* webpackChunkName: "create-post-interaction-log-payload" */'../create-post-interaction-log-payload'));
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
157
|
+
}), Promise.resolve().then(function () {
|
|
158
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "create-interaction-extra-metrics-payload" */'../create-interaction-extra-metrics-payload'));
|
|
159
|
+
})]).then(function (_ref2) {
|
|
160
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 4),
|
|
161
|
+
awc = _ref3[0],
|
|
162
|
+
payloadPackage = _ref3[1],
|
|
163
|
+
createPostInteractionLogPayloadPackage = _ref3[2],
|
|
164
|
+
createInteractionExtraMetricsPayloadPackage = _ref3[3];
|
|
127
165
|
if (awc.getAnalyticsWebClientPromise) {
|
|
128
166
|
awc.getAnalyticsWebClientPromise().then(function (client) {
|
|
129
167
|
var _config$experimentalI2, _config$postInteracti;
|
|
@@ -135,6 +173,9 @@ function init(analyticsWebClientAsync, config) {
|
|
|
135
173
|
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
136
174
|
sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
|
|
137
175
|
}
|
|
176
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
|
|
177
|
+
sinkInteractionExtraMetrics(instance, createInteractionExtraMetricsPayloadPackage.default);
|
|
178
|
+
}
|
|
138
179
|
});
|
|
139
180
|
} else if (awc.sendOperationalEvent) {
|
|
140
181
|
var _config$experimentalI3, _config$postInteracti2;
|
|
@@ -145,6 +186,9 @@ function init(analyticsWebClientAsync, config) {
|
|
|
145
186
|
if ((_config$postInteracti2 = config.postInteractionLog) !== null && _config$postInteracti2 !== void 0 && _config$postInteracti2.enabled) {
|
|
146
187
|
sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
|
|
147
188
|
}
|
|
189
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p')) {
|
|
190
|
+
sinkInteractionExtraMetrics(awc, createInteractionExtraMetricsPayloadPackage.default);
|
|
191
|
+
}
|
|
148
192
|
}
|
|
149
193
|
});
|
|
150
194
|
}
|
|
@@ -15,7 +15,9 @@ var _excluded = ["children"];
|
|
|
15
15
|
function UFOThirdPartySegment(props) {
|
|
16
16
|
var children = props.children,
|
|
17
17
|
otherProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement(_segment.default, (0, _extends2.default)({
|
|
18
|
+
return (0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p') ? /*#__PURE__*/_react.default.createElement(_segment.default, (0, _extends2.default)({
|
|
19
|
+
type: "third-party"
|
|
20
|
+
}, otherProps), children) : /*#__PURE__*/_react.default.createElement(_segment.default, (0, _extends2.default)({
|
|
19
21
|
type: "third-party"
|
|
20
22
|
}, otherProps), /*#__PURE__*/_react.default.createElement(_ignoreHolds.default, {
|
|
21
23
|
ignore: (0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_elements_from_ttai'),
|
package/dist/cjs/ssr/index.js
CHANGED
|
@@ -12,9 +12,10 @@ exports.getSSRSuccess = getSSRSuccess;
|
|
|
12
12
|
exports.getSSRTimings = getSSRTimings;
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
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
16
|
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; }
|
|
17
|
+
//
|
|
18
|
+
|
|
18
19
|
var NESTED_METRIC_SEPARATOR = '/';
|
|
19
20
|
function filterEntry(entry) {
|
|
20
21
|
return !(!entry || (0, _typeof2.default)(entry) !== 'object' || entry.startTime < 0 || entry.duration < 0);
|
|
@@ -23,7 +24,7 @@ function mapEntry(entry) {
|
|
|
23
24
|
return _objectSpread({
|
|
24
25
|
startTime: Math.round(entry.startTime),
|
|
25
26
|
duration: Math.round(entry.duration)
|
|
26
|
-
}, entry.size
|
|
27
|
+
}, entry.size ? {
|
|
27
28
|
size: Math.round(entry.size)
|
|
28
29
|
} : {});
|
|
29
30
|
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _uuid = require("uuid");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _coinflip = _interopRequireDefault(require("../../coinflip"));
|
|
11
10
|
var _config = require("../../config");
|
|
12
11
|
var _experienceTraceIdContext = require("../../experience-trace-id-context");
|
|
@@ -22,15 +21,11 @@ function traceUFOInteraction(name, interactionType, startTime) {
|
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
24
23
|
} else {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
24
|
+
// Abort any existing interaction regardless of the coinflip outcome
|
|
25
|
+
// Ensures measurements are not carried over between distinct interactions
|
|
26
|
+
(0, _interactionMetrics.abortAll)('new_interaction', name);
|
|
29
27
|
}
|
|
30
28
|
if ((0, _coinflip.default)(rate)) {
|
|
31
|
-
if (!(0, _platformFeatureFlags.fg)('platform_ufo_abort_measurement_fix')) {
|
|
32
|
-
(0, _interactionMetrics.abortAll)('new_interaction', name);
|
|
33
|
-
}
|
|
34
29
|
var startTimestamp = startTime !== null && startTime !== void 0 ? startTime : performance.now();
|
|
35
30
|
var newId = (0, _uuid.v4)();
|
|
36
31
|
_interactionIdContext.DefaultInteractionID.current = newId;
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -122,11 +122,11 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
122
122
|
value: function () {
|
|
123
123
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
124
124
|
var _this$oldVCObserver4, _this$newVCObserver3, _ref2;
|
|
125
|
-
var experienceKey, v1v2Result, v3Result;
|
|
125
|
+
var experienceKey, include3p, v1v2Result, v3Result;
|
|
126
126
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
127
127
|
while (1) switch (_context.prev = _context.next) {
|
|
128
128
|
case 0:
|
|
129
|
-
experienceKey = param.experienceKey;
|
|
129
|
+
experienceKey = param.experienceKey, include3p = param.include3p;
|
|
130
130
|
if (!((0, _config.isVCRevisionEnabled)('fy25.01', experienceKey) || (0, _config.isVCRevisionEnabled)('fy25.02', experienceKey))) {
|
|
131
131
|
_context.next = 7;
|
|
132
132
|
break;
|
|
@@ -150,7 +150,8 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
150
150
|
start: param.start,
|
|
151
151
|
stop: param.stop,
|
|
152
152
|
interactionId: param.interactionId,
|
|
153
|
-
ssr: param.includeSSRInV3 ? param.ssr : undefined
|
|
153
|
+
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
154
|
+
include3p: include3p
|
|
154
155
|
});
|
|
155
156
|
case 12:
|
|
156
157
|
_context.t1 = _context.sent;
|
|
@@ -13,7 +13,6 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _config = require("../../config");
|
|
18
17
|
var _interactionMetrics = require("../../interaction-metrics");
|
|
19
18
|
var _attachAbortListeners = require("./attachAbortListeners");
|
|
@@ -179,48 +178,6 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
179
178
|
viewport: viewport,
|
|
180
179
|
fixSSRAttribution: includeSSRRatio
|
|
181
180
|
});
|
|
182
|
-
try {
|
|
183
|
-
if (!_this.isPostInteraction) {
|
|
184
|
-
VCObserver.VCParts.forEach(function (key) {
|
|
185
|
-
if (isTTVCv1Disabled) {
|
|
186
|
-
var duration = vcNext.VC[key];
|
|
187
|
-
if (duration !== null && duration !== undefined) {
|
|
188
|
-
if (!(0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
189
|
-
performance.measure("VC".concat(key), {
|
|
190
|
-
start: start,
|
|
191
|
-
duration: duration
|
|
192
|
-
});
|
|
193
|
-
performance.measure("VC_Next".concat(key), {
|
|
194
|
-
start: start,
|
|
195
|
-
duration: duration
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
} else {
|
|
200
|
-
var ttvcV1duration = VC[key];
|
|
201
|
-
if (ttvcV1duration !== null && ttvcV1duration !== undefined) {
|
|
202
|
-
if (!(0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
203
|
-
performance.measure("VC".concat(key), {
|
|
204
|
-
start: start,
|
|
205
|
-
duration: ttvcV1duration
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
var ttvcV2duration = vcNext.VC[key];
|
|
210
|
-
if (ttvcV2duration !== null && ttvcV2duration !== undefined) {
|
|
211
|
-
if (!(0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift')) {
|
|
212
|
-
performance.measure("VC_Next".concat(key), {
|
|
213
|
-
start: start,
|
|
214
|
-
duration: ttvcV2duration
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
} catch (e) {
|
|
222
|
-
/* empty */
|
|
223
|
-
}
|
|
224
181
|
outOfBoundary = outOfBoundaryInfo ? (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:oob"), outOfBoundaryInfo) : {}; //const oldDomUpdates = oldDomUpdatesEnabled ? { [`${fullPrefix}vc:old:dom`]: vcNext.VCBox } : {};
|
|
225
182
|
stopTime = performance.now(); // exposing data to devtools
|
|
226
183
|
try {
|
|
@@ -344,16 +301,16 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
344
301
|
SSRRatioNext = VCObserver.getSSRRatio(vcNext.VCEntries.rel, ssr);
|
|
345
302
|
SSRRatioPayload = includeSSRRatio ? (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ssrRatio"), isTTVCv1Disabled ? SSRRatioNext : SSRRatio), "".concat(fullPrefix, "vc:next:ssrRatio"), SSRRatioNext) : {};
|
|
346
303
|
if (!isTTVCv1Disabled) {
|
|
347
|
-
_context.next =
|
|
304
|
+
_context.next = 29;
|
|
348
305
|
break;
|
|
349
306
|
}
|
|
350
307
|
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), SSRRatioPayload), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ssrRatio"), SSRRatioNext), revisionsData), speedIndex));
|
|
351
|
-
case
|
|
308
|
+
case 29:
|
|
352
309
|
isTTVCv3Enabled = (0, _config.isVCRevisionEnabled)('fy25.03', experienceKey);
|
|
353
310
|
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
354
311
|
'metrics:vc': VC
|
|
355
312
|
}, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), "".concat(fullPrefix, "vc:ssrRatio"), SSRRatio), outOfBoundary), {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), SSRRatioPayload), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
|
|
356
|
-
case
|
|
313
|
+
case 31:
|
|
357
314
|
case "end":
|
|
358
315
|
return _context.stop();
|
|
359
316
|
}
|
|
@@ -227,11 +227,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
227
227
|
key: "getVCResult",
|
|
228
228
|
value: function () {
|
|
229
229
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
230
|
-
var start, stop, interactionId, results, calculator_fy25_03, orderedEntries, fy25_03;
|
|
230
|
+
var start, stop, interactionId, include3p, results, calculator_fy25_03, orderedEntries, fy25_03;
|
|
231
231
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
232
232
|
while (1) switch (_context.prev = _context.next) {
|
|
233
233
|
case 0:
|
|
234
|
-
start = param.start, stop = param.stop, interactionId = param.interactionId;
|
|
234
|
+
start = param.start, stop = param.stop, interactionId = param.interactionId, include3p = param.include3p;
|
|
235
235
|
results = [];
|
|
236
236
|
this.addStartEntry(start);
|
|
237
237
|
calculator_fy25_03 = new _fy25_.default();
|
|
@@ -248,7 +248,8 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
248
248
|
startTime: start,
|
|
249
249
|
stopTime: stop,
|
|
250
250
|
interactionId: interactionId,
|
|
251
|
-
isPostInteraction: this.isPostInteraction
|
|
251
|
+
isPostInteraction: this.isPostInteraction,
|
|
252
|
+
include3p: include3p
|
|
252
253
|
});
|
|
253
254
|
case 8:
|
|
254
255
|
fy25_03 = _context.sent;
|
|
@@ -323,13 +323,13 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
323
323
|
var _this = this,
|
|
324
324
|
_vcDetails$90$t,
|
|
325
325
|
_vcDetails$;
|
|
326
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
326
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
327
327
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
328
328
|
while (1) switch (_context2.prev = _context2.next) {
|
|
329
329
|
case 0:
|
|
330
|
-
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction;
|
|
330
|
+
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p;
|
|
331
331
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
332
|
-
return _this.isEntryIncluded(entry);
|
|
332
|
+
return _this.isEntryIncluded(entry, include3p);
|
|
333
333
|
});
|
|
334
334
|
getVCCleanStatusResult = this.getVCCleanStatus(filteredEntries);
|
|
335
335
|
isVCClean = getVCCleanStatusResult.isVCClean;
|
|
@@ -17,12 +17,12 @@ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0,
|
|
|
17
17
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
18
|
var ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
|
|
19
19
|
var REVISION_NO = 'fy25.03';
|
|
20
|
-
var getConsideredEntryTypes = function getConsideredEntryTypes() {
|
|
20
|
+
var getConsideredEntryTypes = function getConsideredEntryTypes(include3p) {
|
|
21
21
|
var entryTypes = ['mutation:child-element', 'mutation:element', 'mutation:attribute', 'layout-shift', 'window:event'];
|
|
22
22
|
|
|
23
23
|
// If not exclude 3p elements from ttvc,
|
|
24
24
|
// including the tags into the ConsideredEntryTypes so that it won't be ignored for TTVC calculation
|
|
25
|
-
if (!(0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_elements_from_ttvc')) {
|
|
25
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_elements_from_ttvc') || include3p) {
|
|
26
26
|
entryTypes.push('mutation:third-party-element');
|
|
27
27
|
}
|
|
28
28
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_media_for_ttvc_v3')) {
|
|
@@ -46,8 +46,8 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
|
|
|
46
46
|
(0, _inherits2.default)(VCCalculator_FY25_03, _AbstractVCCalculator);
|
|
47
47
|
return (0, _createClass2.default)(VCCalculator_FY25_03, [{
|
|
48
48
|
key: "isEntryIncluded",
|
|
49
|
-
value: function isEntryIncluded(entry) {
|
|
50
|
-
if (!getConsideredEntryTypes().includes(entry.data.type)) {
|
|
49
|
+
value: function isEntryIncluded(entry, include3p) {
|
|
50
|
+
if (!getConsideredEntryTypes(include3p).includes(entry.data.type)) {
|
|
51
51
|
return false;
|
|
52
52
|
}
|
|
53
53
|
if (entry.data.type === 'mutation:attribute') {
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { getConfig } from '../config';
|
|
2
|
+
import { getMoreAccuratePageVisibilityUpToTTAI } from '../create-payload';
|
|
3
|
+
import { sanitizeUfoName } from '../create-payload/common/utils';
|
|
4
|
+
import getPageVisibilityUpToTTAI from '../create-payload/utils/get-page-visibility-up-to-ttai';
|
|
5
|
+
import getPayloadSize from '../create-payload/utils/get-payload-size';
|
|
6
|
+
import { getReactUFOPayloadVersion } from '../create-payload/utils/get-react-ufo-payload-version';
|
|
7
|
+
import getTTAI from '../create-payload/utils/get-ttai';
|
|
8
|
+
import getVCMetrics from '../create-payload/utils/get-vc-metrics';
|
|
9
|
+
async function createInteractionExtraLogPayload(interactionId, interaction) {
|
|
10
|
+
var _getTTAI, _finalVCMetrics$ufoV, _window$location;
|
|
11
|
+
const config = getConfig();
|
|
12
|
+
if (!config) {
|
|
13
|
+
throw Error('UFO Configuration not provided');
|
|
14
|
+
}
|
|
15
|
+
const {
|
|
16
|
+
end,
|
|
17
|
+
start,
|
|
18
|
+
ufoName,
|
|
19
|
+
rate,
|
|
20
|
+
type,
|
|
21
|
+
abortReason,
|
|
22
|
+
routeName,
|
|
23
|
+
previousInteractionName,
|
|
24
|
+
isPreviousInteractionAborted,
|
|
25
|
+
abortedByInteractionName
|
|
26
|
+
} = interaction;
|
|
27
|
+
const pageVisibilityAtTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
28
|
+
const isPageLoad = type === 'page_load' || type === 'transition';
|
|
29
|
+
if (!isPageLoad) {
|
|
30
|
+
// Only create payload for page load
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const calculatePageVisibilityFromTheStartOfPageLoad = config.enableBetterPageVisibilityApi && isPageLoad;
|
|
34
|
+
const moreAccuratePageVisibilityAtTTAI = calculatePageVisibilityFromTheStartOfPageLoad ? getMoreAccuratePageVisibilityUpToTTAI(interaction) : null;
|
|
35
|
+
const extraTTAI = (_getTTAI = getTTAI(interaction)) !== null && _getTTAI !== void 0 ? _getTTAI : undefined;
|
|
36
|
+
const newUFOName = sanitizeUfoName(ufoName);
|
|
37
|
+
const finalVCMetrics = await getVCMetrics(interaction, true);
|
|
38
|
+
const ttvc = (_finalVCMetrics$ufoV = finalVCMetrics['ufo:vc:rev']) === null || _finalVCMetrics$ufoV === void 0 ? void 0 : _finalVCMetrics$ufoV.map(revision => {
|
|
39
|
+
if (revision['metric:vc90'] === null || revision.clean !== true) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
revision: revision.revision,
|
|
44
|
+
vc90: revision['metric:vc90']
|
|
45
|
+
};
|
|
46
|
+
}).filter(revision => revision != null);
|
|
47
|
+
const payload = {
|
|
48
|
+
actionSubject: 'experience',
|
|
49
|
+
action: 'measured',
|
|
50
|
+
eventType: 'operational',
|
|
51
|
+
source: 'measured',
|
|
52
|
+
tags: ['observability'],
|
|
53
|
+
attributes: {
|
|
54
|
+
properties: {
|
|
55
|
+
// basic
|
|
56
|
+
'event:hostname': ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || 'unknown',
|
|
57
|
+
'event:product': config.product,
|
|
58
|
+
'event:schema': '1.0.0',
|
|
59
|
+
'event:sizeInKb': 0,
|
|
60
|
+
'event:source': {
|
|
61
|
+
name: 'react-ufo/web',
|
|
62
|
+
version: getReactUFOPayloadVersion(interaction.type)
|
|
63
|
+
},
|
|
64
|
+
'event:region': config.region || 'unknown',
|
|
65
|
+
'experience:key': 'custom.interaction-extra-metrics',
|
|
66
|
+
'experience:name': newUFOName,
|
|
67
|
+
interactionMetrics: {
|
|
68
|
+
namePrefix: config.namePrefix || '',
|
|
69
|
+
segmentPrefix: config.segmentPrefix || '',
|
|
70
|
+
interactionId,
|
|
71
|
+
pageVisibilityAtTTAI,
|
|
72
|
+
experimental__pageVisibilityAtTTAI: moreAccuratePageVisibilityAtTTAI,
|
|
73
|
+
// raw interaction metrics
|
|
74
|
+
rate,
|
|
75
|
+
routeName,
|
|
76
|
+
type,
|
|
77
|
+
abortReason,
|
|
78
|
+
previousInteractionName,
|
|
79
|
+
isPreviousInteractionAborted,
|
|
80
|
+
abortedByInteractionName,
|
|
81
|
+
// performance
|
|
82
|
+
end: Math.round(end),
|
|
83
|
+
start: Math.round(start),
|
|
84
|
+
'metric:ttai:3p': extraTTAI,
|
|
85
|
+
ttvc: ttvc !== null && ttvc !== void 0 ? ttvc : undefined
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
payload.attributes.properties['event:sizeInKb'] = getPayloadSize(payload.attributes.properties);
|
|
91
|
+
return payload;
|
|
92
|
+
}
|
|
93
|
+
export default createInteractionExtraLogPayload;
|
|
@@ -124,7 +124,7 @@ function getMoreAccuratePageVisibilityUpToTTI(interaction) {
|
|
|
124
124
|
}
|
|
125
125
|
return old;
|
|
126
126
|
}
|
|
127
|
-
function getMoreAccuratePageVisibilityUpToTTAI(interaction) {
|
|
127
|
+
export function getMoreAccuratePageVisibilityUpToTTAI(interaction) {
|
|
128
128
|
const old = getPageVisibilityUpToTTAI(interaction);
|
|
129
129
|
const buffered = getVisibilityStateFromPerformance(interaction.end);
|
|
130
130
|
if (!buffered) {
|
|
@@ -630,7 +630,7 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
|
|
|
630
630
|
} : {};
|
|
631
631
|
const isBM3ConfigSSRDoneAsFmp = interaction.metaData.__legacy__bm3ConfigSSRDoneAsFmp;
|
|
632
632
|
const isUFOConfigSSRDoneAsFmp = interaction.metaData.__legacy__bm3ConfigSSRDoneAsFmp || !!(config !== null && config !== void 0 && (_config$ssr = config.ssr) !== null && _config$ssr !== void 0 && _config$ssr.getSSRDoneTime);
|
|
633
|
-
if (!experimental && (isBM3ConfigSSRDoneAsFmp || isUFOConfigSSRDoneAsFmp) && SSRDoneTimeValue !== undefined
|
|
633
|
+
if (!experimental && (isBM3ConfigSSRDoneAsFmp || isUFOConfigSSRDoneAsFmp) && SSRDoneTimeValue !== undefined) {
|
|
634
634
|
try {
|
|
635
635
|
performance.mark(`FMP`, {
|
|
636
636
|
startTime: SSRDoneTimeValue,
|
|
@@ -696,7 +696,7 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
|
|
|
696
696
|
const resourceTimings = getResourceTimings(start, end);
|
|
697
697
|
const [finalVCMetrics, experimentalMetrics, paintMetrics] = await Promise.all([vcMetrics || (await getVCMetrics(interaction)), experimental ? getExperimentalVCMetrics(interaction) : Promise.resolve(undefined), getPaintMetricsToLegacyFormat(type, end)]);
|
|
698
698
|
if (!experimental) {
|
|
699
|
-
|
|
699
|
+
addPerformanceMeasures(interaction.start, [...((finalVCMetrics === null || finalVCMetrics === void 0 ? void 0 : finalVCMetrics['ufo:vc:rev']) || [])]);
|
|
700
700
|
}
|
|
701
701
|
const getReactHydrationStats = () => {
|
|
702
702
|
if (!isPageLoad || !hydration) {
|
|
@@ -4,7 +4,7 @@ import { postInteractionLog } from '../../interaction-metrics';
|
|
|
4
4
|
import getInteractionStatus from './get-interaction-status';
|
|
5
5
|
import getPageVisibilityUpToTTAI from './get-page-visibility-up-to-ttai';
|
|
6
6
|
import getSSRDoneTimeValue from './get-ssr-done-time-value';
|
|
7
|
-
async function getVCMetrics(interaction) {
|
|
7
|
+
async function getVCMetrics(interaction, include3p = false) {
|
|
8
8
|
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$vc2, _config$vc3, _result$ufoVcRev;
|
|
9
9
|
const config = getConfig();
|
|
10
10
|
if (!(config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled)) {
|
|
@@ -50,7 +50,8 @@ async function getVCMetrics(interaction) {
|
|
|
50
50
|
experienceKey: interaction.ufoName,
|
|
51
51
|
interactionId: interaction.id,
|
|
52
52
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio,
|
|
53
|
-
...ssr
|
|
53
|
+
...ssr,
|
|
54
|
+
include3p
|
|
54
55
|
});
|
|
55
56
|
observer.stop(interaction.ufoName);
|
|
56
57
|
postInteractionLog.setLastInteractionFinishVCResult(result);
|