@atlaskit/react-ufo 4.0.0 → 4.0.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 +16 -0
- package/dist/cjs/create-payload/index.js +4 -5
- package/dist/cjs/create-post-interaction-log-payload/index.js +2 -3
- package/dist/cjs/interaction-metrics-init/index.js +3 -3
- package/dist/es2019/create-payload/index.js +2 -3
- package/dist/es2019/create-post-interaction-log-payload/index.js +2 -3
- package/dist/es2019/interaction-metrics-init/index.js +3 -3
- package/dist/esm/create-payload/index.js +4 -5
- package/dist/esm/create-post-interaction-log-payload/index.js +2 -3
- package/dist/esm/interaction-metrics-init/index.js +3 -3
- package/dist/types/config/index.d.ts +6 -6
- package/dist/types/create-payload/index.d.ts +577 -577
- package/dist/types-ts4.5/config/index.d.ts +6 -6
- package/dist/types-ts4.5/create-payload/index.d.ts +577 -577
- package/package.json +1 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#185693](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185693)
|
|
8
|
+
[`c8e0df9e675c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c8e0df9e675c4) -
|
|
9
|
+
FG cleanup platform_ufo_post_interaction_most_recent_vc_rev
|
|
10
|
+
|
|
11
|
+
## 4.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#184818](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/184818)
|
|
16
|
+
[`a4cc23a9d8a35`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a4cc23a9d8a35) -
|
|
17
|
+
FG cleanup - platform_ufo_report_cpu_usage
|
|
18
|
+
|
|
3
19
|
## 4.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
|
@@ -697,7 +697,7 @@ function _createInteractionMetricsPayload() {
|
|
|
697
697
|
source: 'measured',
|
|
698
698
|
tags: ['observability'],
|
|
699
699
|
attributes: {
|
|
700
|
-
properties: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
700
|
+
properties: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
701
701
|
// basic
|
|
702
702
|
'event:hostname': ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || 'unknown',
|
|
703
703
|
'event:product': config.product,
|
|
@@ -709,10 +709,9 @@ function _createInteractionMetricsPayload() {
|
|
|
709
709
|
},
|
|
710
710
|
'event:region': config.region || 'unknown',
|
|
711
711
|
'experience:key': experimental ? 'custom.experimental-interaction-metrics' : 'custom.interaction-metrics',
|
|
712
|
-
'experience:name': newUFOName
|
|
713
|
-
|
|
714
|
-
'event:cpu:usage': (0, _machineUtilisation.createPressureStateReport)(interaction.start, interaction.end)
|
|
715
|
-
} : {}), {}, {
|
|
712
|
+
'experience:name': newUFOName,
|
|
713
|
+
// Include CPU usage monitoring data
|
|
714
|
+
'event:cpu:usage': (0, _machineUtilisation.createPressureStateReport)(interaction.start, interaction.end),
|
|
716
715
|
'event:memory:usage': (0, _machineUtilisation.createMemoryStateReport)(interaction.start, interaction.end)
|
|
717
716
|
}, criticalPayloadCount !== undefined ? {
|
|
718
717
|
'ufo:multipayload': true,
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _coinflip = _interopRequireDefault(require("../coinflip"));
|
|
12
11
|
var _config = require("../config");
|
|
13
12
|
var _utils = require("../create-payload/common/utils");
|
|
@@ -115,7 +114,7 @@ function transformReactProfilerTimings(reactProfilerTimings) {
|
|
|
115
114
|
return (0, _toConsumableArray2.default)(reactProfilerTimingsMap.values());
|
|
116
115
|
}
|
|
117
116
|
function createPostInteractionLogPayload(_ref2) {
|
|
118
|
-
var _window$location;
|
|
117
|
+
var _getMostRecentVCRevis, _window$location;
|
|
119
118
|
var lastInteractionFinish = _ref2.lastInteractionFinish,
|
|
120
119
|
reactProfilerTimings = _ref2.reactProfilerTimings,
|
|
121
120
|
lastInteractionFinishVCResult = _ref2.lastInteractionFinishVCResult,
|
|
@@ -154,7 +153,7 @@ function createPostInteractionLogPayload(_ref2) {
|
|
|
154
153
|
var lastInteractionFinishStart = Math.round(lastInteractionFinish.start);
|
|
155
154
|
var lastInteractionFinishEnd = Math.round(lastInteractionFinish.end);
|
|
156
155
|
var lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
|
|
157
|
-
var mostRecentVCRevision = (
|
|
156
|
+
var mostRecentVCRevision = (_getMostRecentVCRevis = (0, _config.getMostRecentVCRevision)(lastInteractionFinish.ufoName)) !== null && _getMostRecentVCRevis !== void 0 ? _getMostRecentVCRevis : _config.DEFAULT_TTVC_REVISION;
|
|
158
157
|
var lastInteractionFinishVC90 = null;
|
|
159
158
|
var lastInteractionFinishVCClean = false;
|
|
160
159
|
var lastInteractionFinishVCRev = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
@@ -84,9 +84,9 @@ function init(analyticsWebClientAsync, config) {
|
|
|
84
84
|
if (initialized) {
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
|
|
88
|
+
// Initialize pressure observer for CPU usage monitoring
|
|
89
|
+
(0, _machineUtilisation.initialisePressureObserver)();
|
|
90
90
|
(0, _machineUtilisation.initialiseMemoryObserver)();
|
|
91
91
|
(0, _config.setUFOConfig)(config);
|
|
92
92
|
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
@@ -695,9 +695,8 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
|
|
|
695
695
|
'event:region': config.region || 'unknown',
|
|
696
696
|
'experience:key': experimental ? 'custom.experimental-interaction-metrics' : 'custom.interaction-metrics',
|
|
697
697
|
'experience:name': newUFOName,
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
} : {}),
|
|
698
|
+
// Include CPU usage monitoring data
|
|
699
|
+
'event:cpu:usage': createPressureStateReport(interaction.start, interaction.end),
|
|
701
700
|
'event:memory:usage': createMemoryStateReport(interaction.start, interaction.end),
|
|
702
701
|
...(criticalPayloadCount !== undefined ? {
|
|
703
702
|
'ufo:multipayload': true,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import coinflip from '../coinflip';
|
|
3
2
|
import { DEFAULT_TTVC_REVISION, getConfig, getMostRecentVCRevision, getPostInteractionRate } from '../config';
|
|
4
3
|
import { isSegmentLabel, sanitizeUfoName } from '../create-payload/common/utils';
|
|
@@ -106,7 +105,7 @@ function createPostInteractionLogPayload({
|
|
|
106
105
|
lastInteractionFinishVCResult,
|
|
107
106
|
postInteractionFinishVCResult
|
|
108
107
|
}) {
|
|
109
|
-
var _window$location;
|
|
108
|
+
var _getMostRecentVCRevis, _window$location;
|
|
110
109
|
const config = getConfig();
|
|
111
110
|
if (!config) {
|
|
112
111
|
throw Error('UFO Configuration not provided');
|
|
@@ -139,7 +138,7 @@ function createPostInteractionLogPayload({
|
|
|
139
138
|
const lastInteractionFinishStart = Math.round(lastInteractionFinish.start);
|
|
140
139
|
const lastInteractionFinishEnd = Math.round(lastInteractionFinish.end);
|
|
141
140
|
const lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
|
|
142
|
-
const mostRecentVCRevision =
|
|
141
|
+
const mostRecentVCRevision = (_getMostRecentVCRevis = getMostRecentVCRevision(lastInteractionFinish.ufoName)) !== null && _getMostRecentVCRevis !== void 0 ? _getMostRecentVCRevis : DEFAULT_TTVC_REVISION;
|
|
143
142
|
let lastInteractionFinishVC90 = null;
|
|
144
143
|
let lastInteractionFinishVCClean = false;
|
|
145
144
|
const lastInteractionFinishVCRev = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
@@ -74,9 +74,9 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
74
74
|
if (initialized) {
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
|
|
78
|
+
// Initialize pressure observer for CPU usage monitoring
|
|
79
|
+
initialisePressureObserver();
|
|
80
80
|
initialiseMemoryObserver();
|
|
81
81
|
setUFOConfig(config);
|
|
82
82
|
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
@@ -690,7 +690,7 @@ function _createInteractionMetricsPayload() {
|
|
|
690
690
|
source: 'measured',
|
|
691
691
|
tags: ['observability'],
|
|
692
692
|
attributes: {
|
|
693
|
-
properties: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
693
|
+
properties: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
694
694
|
// basic
|
|
695
695
|
'event:hostname': ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || 'unknown',
|
|
696
696
|
'event:product': config.product,
|
|
@@ -702,10 +702,9 @@ function _createInteractionMetricsPayload() {
|
|
|
702
702
|
},
|
|
703
703
|
'event:region': config.region || 'unknown',
|
|
704
704
|
'experience:key': experimental ? 'custom.experimental-interaction-metrics' : 'custom.interaction-metrics',
|
|
705
|
-
'experience:name': newUFOName
|
|
706
|
-
|
|
707
|
-
'event:cpu:usage': createPressureStateReport(interaction.start, interaction.end)
|
|
708
|
-
} : {}), {}, {
|
|
705
|
+
'experience:name': newUFOName,
|
|
706
|
+
// Include CPU usage monitoring data
|
|
707
|
+
'event:cpu:usage': createPressureStateReport(interaction.start, interaction.end),
|
|
709
708
|
'event:memory:usage': createMemoryStateReport(interaction.start, interaction.end)
|
|
710
709
|
}, criticalPayloadCount !== undefined ? {
|
|
711
710
|
'ufo:multipayload': true,
|
|
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import coinflip from '../coinflip';
|
|
7
6
|
import { DEFAULT_TTVC_REVISION, getConfig, getMostRecentVCRevision, getPostInteractionRate } from '../config';
|
|
8
7
|
import { isSegmentLabel, sanitizeUfoName } from '../create-payload/common/utils';
|
|
@@ -108,7 +107,7 @@ function transformReactProfilerTimings(reactProfilerTimings) {
|
|
|
108
107
|
return _toConsumableArray(reactProfilerTimingsMap.values());
|
|
109
108
|
}
|
|
110
109
|
function createPostInteractionLogPayload(_ref2) {
|
|
111
|
-
var _window$location;
|
|
110
|
+
var _getMostRecentVCRevis, _window$location;
|
|
112
111
|
var lastInteractionFinish = _ref2.lastInteractionFinish,
|
|
113
112
|
reactProfilerTimings = _ref2.reactProfilerTimings,
|
|
114
113
|
lastInteractionFinishVCResult = _ref2.lastInteractionFinishVCResult,
|
|
@@ -147,7 +146,7 @@ function createPostInteractionLogPayload(_ref2) {
|
|
|
147
146
|
var lastInteractionFinishStart = Math.round(lastInteractionFinish.start);
|
|
148
147
|
var lastInteractionFinishEnd = Math.round(lastInteractionFinish.end);
|
|
149
148
|
var lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
|
|
150
|
-
var mostRecentVCRevision =
|
|
149
|
+
var mostRecentVCRevision = (_getMostRecentVCRevis = getMostRecentVCRevision(lastInteractionFinish.ufoName)) !== null && _getMostRecentVCRevis !== void 0 ? _getMostRecentVCRevis : DEFAULT_TTVC_REVISION;
|
|
151
150
|
var lastInteractionFinishVC90 = null;
|
|
152
151
|
var lastInteractionFinishVCClean = false;
|
|
153
152
|
var lastInteractionFinishVCRev = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
@@ -75,9 +75,9 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
75
75
|
if (initialized) {
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
|
|
79
|
+
// Initialize pressure observer for CPU usage monitoring
|
|
80
|
+
initialisePressureObserver();
|
|
81
81
|
initialiseMemoryObserver();
|
|
82
82
|
setUFOConfig(config);
|
|
83
83
|
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
@@ -27,7 +27,7 @@ type SelectorConfig = {
|
|
|
27
27
|
type Rates = {
|
|
28
28
|
readonly [key: string]: number;
|
|
29
29
|
};
|
|
30
|
-
export type
|
|
30
|
+
export type TTVCRevision = 'fy25.01' | 'fy25.02' | 'fy25.03';
|
|
31
31
|
export declare const DEFAULT_TTVC_REVISION = "fy25.03";
|
|
32
32
|
export type Config = {
|
|
33
33
|
readonly enabled?: boolean;
|
|
@@ -92,8 +92,8 @@ export type Config = {
|
|
|
92
92
|
* i.e. every element for all `byExperience` entry configs should exist in the `all` config
|
|
93
93
|
*/
|
|
94
94
|
readonly enabledVCRevisions?: {
|
|
95
|
-
all: readonly
|
|
96
|
-
byExperience?: Record<string, readonly
|
|
95
|
+
all: readonly TTVCRevision[];
|
|
96
|
+
byExperience?: Record<string, readonly TTVCRevision[]>;
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
readonly postInteractionLog?: {
|
|
@@ -118,9 +118,9 @@ export type Config = {
|
|
|
118
118
|
};
|
|
119
119
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
120
120
|
export declare function getConfig(): Config | undefined;
|
|
121
|
-
export declare function getEnabledVCRevisions(experienceKey?: string): readonly
|
|
122
|
-
export declare function isVCRevisionEnabled(revision:
|
|
123
|
-
export declare function getMostRecentVCRevision(experienceKey?: string):
|
|
121
|
+
export declare function getEnabledVCRevisions(experienceKey?: string): readonly TTVCRevision[];
|
|
122
|
+
export declare function isVCRevisionEnabled(revision: TTVCRevision, experienceKey?: string): boolean;
|
|
123
|
+
export declare function getMostRecentVCRevision(experienceKey?: string): TTVCRevision;
|
|
124
124
|
export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
|
|
125
125
|
export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
|
|
126
126
|
export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
|