@atlaskit/react-ufo 3.4.14 → 3.5.0
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 +8 -0
- package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +5 -4
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +6 -6
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -2
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/cjs/assets/index.js +17 -14
- package/dist/cjs/assets/utils.js +9 -8
- package/dist/cjs/bundle-eval-timing/index.js +8 -8
- package/dist/cjs/coinflip/index.js +5 -3
- package/dist/cjs/common/constants.js +3 -2
- package/dist/cjs/common/react-ufo-payload-schema.js +5 -0
- package/dist/cjs/config/index.js +30 -42
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +29 -39
- package/dist/cjs/create-payload/common/utils/index.js +16 -20
- package/dist/cjs/create-payload/index.js +150 -140
- package/dist/cjs/create-payload/utils/get-interaction-status.js +5 -3
- package/dist/cjs/create-payload/utils/get-page-visibility-up-to-ttai.js +5 -3
- package/dist/cjs/create-payload/utils/get-ssr-done-time-value.js +5 -3
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +10 -8
- package/dist/cjs/create-post-interaction-log-payload/index.js +15 -13
- package/dist/cjs/custom-data/index.js +4 -3
- package/dist/cjs/custom-mark/index.js +4 -3
- package/dist/cjs/custom-spans/index.js +4 -3
- package/dist/cjs/custom-timings/index.js +6 -6
- package/dist/cjs/experience-trace-id-context/index.js +15 -14
- package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -2
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +11 -10
- package/dist/cjs/feature-flags-accessed/index.js +3 -2
- package/dist/cjs/generate-id/index.js +5 -3
- package/dist/cjs/global-error-handler/index.js +14 -13
- package/dist/cjs/initial-page-load-extra-timing/index.js +6 -6
- package/dist/cjs/interaction-metrics/index.js +110 -145
- package/dist/cjs/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/cjs/interaction-metrics-init/index.js +17 -10
- package/dist/cjs/interaction-metrics-init/schedule-idle-callback.js +8 -4
- package/dist/cjs/resource-timing/common/utils/config.js +10 -10
- package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +13 -12
- package/dist/cjs/resource-timing/main.js +25 -19
- package/dist/cjs/resource-timing/utils.js +4 -3
- package/dist/cjs/round-number/index.js +3 -2
- package/dist/cjs/route-name/index.js +5 -3
- package/dist/cjs/segment/schedule-on-paint.js +6 -3
- package/dist/cjs/segment/segment.js +7 -3
- package/dist/cjs/self-measurements/index.js +261 -0
- package/dist/cjs/set-interaction-error/index.js +4 -3
- package/dist/cjs/short-id/index.js +5 -3
- package/dist/cjs/ssr/index.js +18 -21
- package/dist/cjs/trace-interaction/index.js +7 -5
- package/dist/cjs/trace-pageload/index.js +7 -6
- package/dist/cjs/trace-press/index.js +5 -3
- package/dist/cjs/trace-redirect/index.js +5 -3
- package/dist/cjs/trace-transition/index.js +6 -4
- package/dist/cjs/trace-transition/utils/generate-span-id/index.js +3 -2
- package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/cjs/vc/index.js +17 -6
- package/dist/cjs/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +41 -22
- package/dist/cjs/vc/vc-observer/getViewport.js +6 -6
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +28 -12
- package/dist/cjs/vc/vc-observer/index.js +172 -133
- package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/cjs/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/cjs/vc/vc-observer/observers/index.js +82 -25
- package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +5 -3
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +16 -0
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +2 -0
- package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/cjs/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/get-element-name.js +5 -3
- package/dist/cjs/vc/vc-observer-new/get-unique-element-name.js +13 -11
- package/dist/cjs/vc/vc-observer-new/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +6 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +20 -12
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +27 -26
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +27 -14
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +10 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +50 -40
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +10 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/task-yield.js +10 -8
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/cjs/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +16 -13
- package/dist/cjs/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -9
- package/dist/cjs/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +6 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +6 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +16 -13
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/es2019/assets/index.js +19 -14
- package/dist/es2019/assets/utils.js +11 -9
- package/dist/es2019/bundle-eval-timing/index.js +7 -6
- package/dist/es2019/coinflip/index.js +5 -2
- package/dist/es2019/common/constants.js +3 -2
- package/dist/es2019/common/react-ufo-payload-schema.js +1 -0
- package/dist/es2019/config/index.js +29 -28
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +18 -15
- package/dist/es2019/create-payload/common/utils/index.js +15 -14
- package/dist/es2019/create-payload/index.js +87 -71
- package/dist/es2019/create-payload/utils/get-interaction-status.js +5 -2
- package/dist/es2019/create-payload/utils/get-page-visibility-up-to-ttai.js +4 -2
- package/dist/es2019/create-payload/utils/get-ssr-done-time-value.js +4 -2
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +4 -2
- package/dist/es2019/create-post-interaction-log-payload/index.js +14 -12
- package/dist/es2019/custom-data/index.js +3 -2
- package/dist/es2019/custom-mark/index.js +3 -2
- package/dist/es2019/custom-spans/index.js +3 -2
- package/dist/es2019/custom-timings/index.js +5 -4
- package/dist/es2019/experience-trace-id-context/index.js +16 -13
- package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +6 -3
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +14 -7
- package/dist/es2019/feature-flags-accessed/index.js +3 -2
- package/dist/es2019/generate-id/index.js +4 -2
- package/dist/es2019/global-error-handler/index.js +15 -12
- package/dist/es2019/initial-page-load-extra-timing/index.js +5 -4
- package/dist/es2019/interaction-metrics/index.js +109 -108
- package/dist/es2019/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/es2019/interaction-metrics-init/index.js +17 -10
- package/dist/es2019/interaction-metrics-init/schedule-idle-callback.js +7 -3
- package/dist/es2019/resource-timing/common/utils/config.js +10 -7
- package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +14 -11
- package/dist/es2019/resource-timing/main.js +31 -17
- package/dist/es2019/resource-timing/utils.js +3 -2
- package/dist/es2019/round-number/index.js +3 -2
- package/dist/es2019/route-name/index.js +4 -2
- package/dist/es2019/segment/schedule-on-paint.js +5 -2
- package/dist/es2019/segment/segment.js +7 -3
- package/dist/es2019/self-measurements/index.js +213 -0
- package/dist/es2019/set-interaction-error/index.js +3 -2
- package/dist/es2019/short-id/index.js +4 -2
- package/dist/es2019/ssr/index.js +21 -16
- package/dist/es2019/trace-interaction/index.js +6 -4
- package/dist/es2019/trace-pageload/index.js +6 -4
- package/dist/es2019/trace-press/index.js +4 -2
- package/dist/es2019/trace-redirect/index.js +4 -2
- package/dist/es2019/trace-transition/index.js +5 -3
- package/dist/es2019/trace-transition/utils/generate-span-id/index.js +4 -1
- package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/es2019/vc/index.js +16 -4
- package/dist/es2019/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +41 -21
- package/dist/es2019/vc/vc-observer/getViewport.js +5 -4
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +28 -10
- package/dist/es2019/vc/vc-observer/index.js +160 -116
- package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/es2019/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/es2019/vc/vc-observer/observers/index.js +80 -25
- package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +4 -2
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +16 -0
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +2 -0
- package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/es2019/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/get-element-name.js +4 -2
- package/dist/es2019/vc/vc-observer-new/get-unique-element-name.js +12 -10
- package/dist/es2019/vc/vc-observer-new/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +3 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +14 -4
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +6 -4
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +21 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +10 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/task-yield.js +5 -2
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/es2019/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -13
- package/dist/es2019/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -9
- package/dist/es2019/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +5 -4
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +5 -4
- package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -2
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/esm/assets/index.js +17 -14
- package/dist/esm/assets/utils.js +10 -8
- package/dist/esm/bundle-eval-timing/index.js +7 -6
- package/dist/esm/coinflip/index.js +5 -2
- package/dist/esm/common/constants.js +3 -2
- package/dist/esm/common/react-ufo-payload-schema.js +1 -0
- package/dist/esm/config/index.js +29 -28
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +28 -35
- package/dist/esm/create-payload/common/utils/index.js +15 -14
- package/dist/esm/create-payload/index.js +149 -139
- package/dist/esm/create-payload/utils/get-interaction-status.js +5 -2
- package/dist/esm/create-payload/utils/get-page-visibility-up-to-ttai.js +4 -2
- package/dist/esm/create-payload/utils/get-ssr-done-time-value.js +4 -2
- package/dist/esm/create-payload/utils/get-vc-metrics.js +9 -7
- package/dist/esm/create-post-interaction-log-payload/index.js +14 -12
- package/dist/esm/custom-data/index.js +3 -2
- package/dist/esm/custom-mark/index.js +3 -2
- package/dist/esm/custom-spans/index.js +3 -2
- package/dist/esm/custom-timings/index.js +5 -4
- package/dist/esm/experience-trace-id-context/index.js +15 -14
- package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -2
- package/dist/esm/feature-flags-accessed/common/utils/index.js +11 -10
- package/dist/esm/feature-flags-accessed/index.js +3 -2
- package/dist/esm/generate-id/index.js +4 -2
- package/dist/esm/global-error-handler/index.js +14 -13
- package/dist/esm/initial-page-load-extra-timing/index.js +5 -4
- package/dist/esm/interaction-metrics/index.js +109 -108
- package/dist/esm/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/esm/interaction-metrics-init/index.js +17 -10
- package/dist/esm/interaction-metrics-init/schedule-idle-callback.js +7 -3
- package/dist/esm/resource-timing/common/utils/config.js +9 -8
- package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +13 -12
- package/dist/esm/resource-timing/main.js +25 -19
- package/dist/esm/resource-timing/utils.js +3 -2
- package/dist/esm/round-number/index.js +3 -2
- package/dist/esm/route-name/index.js +4 -2
- package/dist/esm/segment/schedule-on-paint.js +5 -2
- package/dist/esm/segment/segment.js +7 -3
- package/dist/esm/self-measurements/index.js +246 -0
- package/dist/esm/set-interaction-error/index.js +3 -2
- package/dist/esm/short-id/index.js +4 -2
- package/dist/esm/ssr/index.js +17 -16
- package/dist/esm/trace-interaction/index.js +6 -4
- package/dist/esm/trace-pageload/index.js +6 -4
- package/dist/esm/trace-press/index.js +4 -2
- package/dist/esm/trace-redirect/index.js +4 -2
- package/dist/esm/trace-transition/index.js +5 -3
- package/dist/esm/trace-transition/utils/generate-span-id/index.js +3 -2
- package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/esm/vc/index.js +16 -4
- package/dist/esm/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +40 -21
- package/dist/esm/vc/vc-observer/getViewport.js +5 -4
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +28 -12
- package/dist/esm/vc/vc-observer/index.js +172 -133
- package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/esm/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/esm/vc/vc-observer/observers/index.js +82 -25
- package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +4 -2
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +16 -0
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +2 -0
- package/dist/esm/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/esm/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/esm/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/get-element-name.js +4 -2
- package/dist/esm/vc/vc-observer-new/get-unique-element-name.js +12 -10
- package/dist/esm/vc/vc-observer-new/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +6 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +19 -9
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +26 -24
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +26 -13
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +9 -7
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +49 -39
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +9 -7
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/task-yield.js +10 -7
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/esm/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -7
- package/dist/esm/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +1 -1
- package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +2 -2
- package/dist/types/assets/index.d.ts +3 -1
- package/dist/types/assets/utils.d.ts +1 -1
- package/dist/types/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types/coinflip/index.d.ts +2 -1
- package/dist/types/common/index.d.ts +2 -1
- package/dist/types/common/react-ufo-payload-schema.d.ts +175 -0
- package/dist/types/common/vc/types.d.ts +20 -10
- package/dist/types/config/index.d.ts +14 -16
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +4 -3
- package/dist/types/create-payload/common/utils/index.d.ts +6 -7
- package/dist/types/create-payload/index.d.ts +1250 -1537
- package/dist/types/create-payload/utils/get-interaction-status.d.ts +2 -1
- package/dist/types/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -1
- package/dist/types/create-payload/utils/get-ssr-done-time-value.d.ts +2 -1
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +3 -2
- package/dist/types/create-post-interaction-log-payload/index.d.ts +3 -2
- package/dist/types/custom-data/index.d.ts +1 -1
- package/dist/types/custom-mark/index.d.ts +1 -1
- package/dist/types/custom-spans/index.d.ts +1 -1
- package/dist/types/custom-timings/index.d.ts +2 -2
- package/dist/types/generate-id/index.d.ts +2 -1
- package/dist/types/hidden-timing/index.d.ts +1 -1
- package/dist/types/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types/interaction-context/index.d.ts +3 -3
- package/dist/types/interaction-metrics/index.d.ts +42 -42
- package/dist/types/interaction-metrics/post-interaction-log.d.ts +1 -0
- package/dist/types/interaction-metrics-init/schedule-idle-callback.d.ts +2 -1
- package/dist/types/resource-timing/common/utils/config.d.ts +1 -1
- package/dist/types/resource-timing/utils.d.ts +1 -1
- package/dist/types/round-number/index.d.ts +1 -1
- package/dist/types/route-name/index.d.ts +4 -3
- package/dist/types/segment/schedule-on-paint.d.ts +2 -1
- package/dist/types/self-measurements/index.d.ts +57 -0
- package/dist/types/set-interaction-error/index.d.ts +1 -1
- package/dist/types/short-id/index.d.ts +2 -1
- package/dist/types/ssr/index.d.ts +5 -5
- package/dist/types/trace-interaction/index.d.ts +2 -1
- package/dist/types/trace-pageload/index.d.ts +3 -2
- package/dist/types/trace-press/index.d.ts +2 -1
- package/dist/types/trace-redirect/index.d.ts +2 -1
- package/dist/types/trace-transition/index.d.ts +2 -1
- package/dist/types/vc/index.d.ts +2 -2
- package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +7 -7
- package/dist/types/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +7 -4
- package/dist/types/vc/vc-observer/index.d.ts +4 -4
- package/dist/types/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +5 -4
- package/dist/types/vc/vc-observer/observers/types.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/get-element-name.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/get-unique-element-name.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +2 -3
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +3 -3
- package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +1 -1
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +2 -2
- package/dist/types-ts4.5/assets/index.d.ts +3 -1
- package/dist/types-ts4.5/assets/utils.d.ts +1 -1
- package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/coinflip/index.d.ts +2 -1
- package/dist/types-ts4.5/common/index.d.ts +2 -1
- package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +177 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +20 -10
- package/dist/types-ts4.5/config/index.d.ts +14 -20
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +4 -3
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +6 -7
- package/dist/types-ts4.5/create-payload/index.d.ts +1250 -1537
- package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-ssr-done-time-value.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +3 -2
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +3 -2
- package/dist/types-ts4.5/custom-data/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-mark/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-spans/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-timings/index.d.ts +2 -2
- package/dist/types-ts4.5/generate-id/index.d.ts +2 -1
- package/dist/types-ts4.5/hidden-timing/index.d.ts +1 -1
- package/dist/types-ts4.5/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/interaction-context/index.d.ts +3 -3
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +42 -42
- package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +1 -0
- package/dist/types-ts4.5/interaction-metrics-init/schedule-idle-callback.d.ts +2 -1
- package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +1 -1
- package/dist/types-ts4.5/resource-timing/utils.d.ts +1 -1
- package/dist/types-ts4.5/round-number/index.d.ts +1 -1
- package/dist/types-ts4.5/route-name/index.d.ts +4 -3
- package/dist/types-ts4.5/segment/schedule-on-paint.d.ts +2 -1
- package/dist/types-ts4.5/self-measurements/index.d.ts +57 -0
- package/dist/types-ts4.5/set-interaction-error/index.d.ts +1 -1
- package/dist/types-ts4.5/short-id/index.d.ts +2 -1
- package/dist/types-ts4.5/ssr/index.d.ts +5 -5
- package/dist/types-ts4.5/trace-interaction/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-pageload/index.d.ts +3 -2
- package/dist/types-ts4.5/trace-press/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-redirect/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-transition/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +7 -7
- package/dist/types-ts4.5/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +7 -4
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +4 -4
- package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +5 -4
- package/dist/types-ts4.5/vc/vc-observer/observers/types.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-element-name.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-unique-element-name.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +2 -3
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +3 -3
- package/package.json +10 -1
|
@@ -15,13 +15,14 @@ import { interactionSpans as atlaskitInteractionSpans } from '../interaction-met
|
|
|
15
15
|
import * as resourceTiming from '../resource-timing';
|
|
16
16
|
import { filterResourceTimings } from '../resource-timing/common/utils/resource-timing-buffer';
|
|
17
17
|
import { roundEpsilon } from '../round-number';
|
|
18
|
+
import { getProfilerAsyncRuntime, getProfilerRuntimeByTag, getProfilerTotalRuntime, markProfilingEnd, markProfilingStart, resetProfilerMeasurements, withProfiling } from '../self-measurements';
|
|
18
19
|
import * as ssr from '../ssr';
|
|
19
20
|
import { buildSegmentTree, labelStackStartWith, optimizeLabelStack, sanitizeUfoName, stringifyLabelStackFully } from './common/utils';
|
|
20
21
|
import getInteractionStatus from './utils/get-interaction-status';
|
|
21
22
|
import getPageVisibilityUpToTTAI from './utils/get-page-visibility-up-to-ttai';
|
|
22
23
|
import getSSRDoneTimeValue from './utils/get-ssr-done-time-value';
|
|
23
24
|
import getVCMetrics from './utils/get-vc-metrics';
|
|
24
|
-
function getUfoNameOverride(interaction) {
|
|
25
|
+
const getUfoNameOverride = withProfiling(function getUfoNameOverride(interaction) {
|
|
25
26
|
const {
|
|
26
27
|
ufoName,
|
|
27
28
|
apdex
|
|
@@ -38,8 +39,8 @@ function getUfoNameOverride(interaction) {
|
|
|
38
39
|
} catch (e) {
|
|
39
40
|
return ufoName;
|
|
40
41
|
}
|
|
41
|
-
}
|
|
42
|
-
function getEarliestLegacyStopTime(interaction, labelStack) {
|
|
42
|
+
});
|
|
43
|
+
const getEarliestLegacyStopTime = withProfiling(function getEarliestLegacyStopTime(interaction, labelStack) {
|
|
43
44
|
let earliestLegacyStopTime = null;
|
|
44
45
|
interaction.apdex.forEach(a => {
|
|
45
46
|
var _a$labelStack, _earliestLegacyStopTi;
|
|
@@ -54,22 +55,22 @@ function getEarliestLegacyStopTime(interaction, labelStack) {
|
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
57
|
return earliestLegacyStopTime;
|
|
57
|
-
}
|
|
58
|
-
function getBm3EndTimeOrFallbackValue(interaction, labelStack = [], fallbackValue = interaction.end) {
|
|
58
|
+
});
|
|
59
|
+
const getBm3EndTimeOrFallbackValue = withProfiling(function getBm3EndTimeOrFallbackValue(interaction, labelStack = [], fallbackValue = interaction.end) {
|
|
59
60
|
var _getEarliestLegacySto;
|
|
60
61
|
if (interaction.type === 'press') {
|
|
61
62
|
return fallbackValue;
|
|
62
63
|
}
|
|
63
64
|
return (_getEarliestLegacySto = getEarliestLegacyStopTime(interaction, labelStack)) !== null && _getEarliestLegacySto !== void 0 ? _getEarliestLegacySto : fallbackValue;
|
|
64
|
-
}
|
|
65
|
-
const getPageVisibilityUpToTTI = interaction
|
|
65
|
+
});
|
|
66
|
+
const getPageVisibilityUpToTTI = withProfiling(function getPageVisibilityUpToTTI(interaction) {
|
|
66
67
|
const {
|
|
67
68
|
start
|
|
68
69
|
} = interaction;
|
|
69
70
|
const bm3EndTimeOrInteractionEndTime = getBm3EndTimeOrFallbackValue(interaction);
|
|
70
71
|
return getPageVisibilityState(start, bm3EndTimeOrInteractionEndTime);
|
|
71
|
-
};
|
|
72
|
-
const getVisibilityStateFromPerformance = stop
|
|
72
|
+
});
|
|
73
|
+
const getVisibilityStateFromPerformance = withProfiling(function getVisibilityStateFromPerformance(stop) {
|
|
73
74
|
try {
|
|
74
75
|
const results = performance.getEntriesByType('visibility-state');
|
|
75
76
|
if (!results || results.length === 0) {
|
|
@@ -96,8 +97,8 @@ const getVisibilityStateFromPerformance = stop => {
|
|
|
96
97
|
} catch (e) {
|
|
97
98
|
return null;
|
|
98
99
|
}
|
|
99
|
-
};
|
|
100
|
-
const getMoreAccuratePageVisibilityUpToTTI = interaction
|
|
100
|
+
});
|
|
101
|
+
const getMoreAccuratePageVisibilityUpToTTI = withProfiling(function getMoreAccuratePageVisibilityUpToTTI(interaction) {
|
|
101
102
|
const old = getPageVisibilityUpToTTI(interaction);
|
|
102
103
|
const tti = getEarliestLegacyStopTime(interaction, []);
|
|
103
104
|
if (!tti) {
|
|
@@ -111,8 +112,8 @@ const getMoreAccuratePageVisibilityUpToTTI = interaction => {
|
|
|
111
112
|
return 'mixed';
|
|
112
113
|
}
|
|
113
114
|
return old;
|
|
114
|
-
};
|
|
115
|
-
const getMoreAccuratePageVisibilityUpToTTAI = interaction
|
|
115
|
+
});
|
|
116
|
+
const getMoreAccuratePageVisibilityUpToTTAI = withProfiling(function getMoreAccuratePageVisibilityUpToTTAI(interaction) {
|
|
116
117
|
const old = getPageVisibilityUpToTTAI(interaction);
|
|
117
118
|
const buffered = getVisibilityStateFromPerformance(interaction.end);
|
|
118
119
|
if (!buffered) {
|
|
@@ -122,15 +123,21 @@ const getMoreAccuratePageVisibilityUpToTTAI = interaction => {
|
|
|
122
123
|
return 'mixed';
|
|
123
124
|
}
|
|
124
125
|
return old;
|
|
125
|
-
};
|
|
126
|
-
const getResourceTimings = (start, end)
|
|
126
|
+
});
|
|
127
|
+
const getResourceTimings = withProfiling(function getResourceTimings(start, end) {
|
|
127
128
|
var _resourceTiming$getRe;
|
|
128
129
|
return (_resourceTiming$getRe = resourceTiming.getResourceTimings(start, end)) !== null && _resourceTiming$getRe !== void 0 ? _resourceTiming$getRe : undefined;
|
|
129
|
-
};
|
|
130
|
-
const getBundleEvalTimings =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const
|
|
130
|
+
});
|
|
131
|
+
const getBundleEvalTimings = withProfiling(function getBundleEvalTimings(start) {
|
|
132
|
+
return bundleEvalTiming.getBundleEvalTimings(start);
|
|
133
|
+
});
|
|
134
|
+
const getSSRSuccess = withProfiling(function getSSRSuccess(type) {
|
|
135
|
+
return type === 'page_load' ? ssr.getSSRSuccess() : undefined;
|
|
136
|
+
});
|
|
137
|
+
const getSSRFeatureFlags = withProfiling(function getSSRFeatureFlags(type) {
|
|
138
|
+
return type === 'page_load' ? ssr.getSSRFeatureFlags() : undefined;
|
|
139
|
+
});
|
|
140
|
+
const getLCP = withProfiling(function getLCP(end) {
|
|
134
141
|
return new Promise(resolve => {
|
|
135
142
|
let observer;
|
|
136
143
|
const timeout = setTimeout(() => {
|
|
@@ -138,7 +145,7 @@ const getLCP = end => {
|
|
|
138
145
|
(_observer = observer) === null || _observer === void 0 ? void 0 : _observer.disconnect();
|
|
139
146
|
resolve(null);
|
|
140
147
|
}, 200);
|
|
141
|
-
|
|
148
|
+
const performanceObserverCallback = withProfiling(function performanceObserverCallback(list) {
|
|
142
149
|
const entries = Array.from(list.getEntries());
|
|
143
150
|
const lastEntry = entries.reduce((agg, entry) => {
|
|
144
151
|
// Use the latest LCP candidate before TTAI
|
|
@@ -154,13 +161,14 @@ const getLCP = end => {
|
|
|
154
161
|
resolve(lastEntry.startTime);
|
|
155
162
|
}
|
|
156
163
|
});
|
|
164
|
+
observer = new PerformanceObserver(performanceObserverCallback);
|
|
157
165
|
observer.observe({
|
|
158
166
|
type: 'largest-contentful-paint',
|
|
159
167
|
buffered: true
|
|
160
168
|
});
|
|
161
169
|
});
|
|
162
|
-
};
|
|
163
|
-
const getPaintMetrics = async (type, end)
|
|
170
|
+
});
|
|
171
|
+
const getPaintMetrics = withProfiling(async function getPaintMetrics(type, end) {
|
|
164
172
|
if (type !== 'page_load') {
|
|
165
173
|
return {};
|
|
166
174
|
}
|
|
@@ -178,16 +186,16 @@ const getPaintMetrics = async (type, end) => {
|
|
|
178
186
|
metrics['metric:lcp'] = Math.round(lcp);
|
|
179
187
|
}
|
|
180
188
|
return metrics;
|
|
181
|
-
};
|
|
182
|
-
const getTTAI = interaction
|
|
189
|
+
});
|
|
190
|
+
const getTTAI = withProfiling(function getTTAI(interaction) {
|
|
183
191
|
const {
|
|
184
192
|
start,
|
|
185
193
|
end
|
|
186
194
|
} = interaction;
|
|
187
195
|
const pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
188
196
|
return !interaction.abortReason && pageVisibilityUpToTTAI === 'visible' ? Math.round(end - start) : undefined;
|
|
189
|
-
};
|
|
190
|
-
const getNavigationMetrics = type
|
|
197
|
+
});
|
|
198
|
+
const getNavigationMetrics = withProfiling(function getNavigationMetrics(type) {
|
|
191
199
|
if (type !== 'page_load') {
|
|
192
200
|
return {};
|
|
193
201
|
}
|
|
@@ -232,8 +240,8 @@ const getNavigationMetrics = type => {
|
|
|
232
240
|
return {
|
|
233
241
|
'metrics:navigation': metrics
|
|
234
242
|
};
|
|
235
|
-
};
|
|
236
|
-
const getPPSMetrics = interaction
|
|
243
|
+
});
|
|
244
|
+
const getPPSMetrics = withProfiling(function getPPSMetrics(interaction) {
|
|
237
245
|
var _interaction$apdex, _interaction$apdex$;
|
|
238
246
|
const {
|
|
239
247
|
start,
|
|
@@ -262,14 +270,14 @@ const getPPSMetrics = interaction => {
|
|
|
262
270
|
};
|
|
263
271
|
}
|
|
264
272
|
return {};
|
|
265
|
-
};
|
|
266
|
-
function getSSRProperties(type) {
|
|
273
|
+
});
|
|
274
|
+
const getSSRProperties = withProfiling(function getSSRProperties(type) {
|
|
267
275
|
return {
|
|
268
276
|
'ssr:success': getSSRSuccess(type),
|
|
269
277
|
'ssr:featureFlags': getSSRFeatureFlags(type)
|
|
270
278
|
};
|
|
271
|
-
}
|
|
272
|
-
const getAssetsMetrics = (interaction, SSRDoneTime)
|
|
279
|
+
});
|
|
280
|
+
const getAssetsMetrics = withProfiling(function getAssetsMetrics(interaction, SSRDoneTime) {
|
|
273
281
|
try {
|
|
274
282
|
const config = getConfig();
|
|
275
283
|
const {
|
|
@@ -295,8 +303,8 @@ const getAssetsMetrics = (interaction, SSRDoneTime) => {
|
|
|
295
303
|
// Skip CHR in case of error
|
|
296
304
|
return {};
|
|
297
305
|
}
|
|
298
|
-
};
|
|
299
|
-
const getBrowserMetadata = ()
|
|
306
|
+
});
|
|
307
|
+
const getBrowserMetadata = withProfiling(function getBrowserMetadata() {
|
|
300
308
|
const data = {};
|
|
301
309
|
const now = new Date();
|
|
302
310
|
data['event:localHour'] = now.getHours(); // returns the hours for this date according to local time
|
|
@@ -322,8 +330,8 @@ const getBrowserMetadata = () => {
|
|
|
322
330
|
data['event:network:downlink'] = navigator.connection.downlink;
|
|
323
331
|
}
|
|
324
332
|
return data;
|
|
325
|
-
};
|
|
326
|
-
const getTracingContextData = interaction
|
|
333
|
+
});
|
|
334
|
+
const getTracingContextData = withProfiling(function getTracingContextData(interaction) {
|
|
327
335
|
const {
|
|
328
336
|
trace,
|
|
329
337
|
start
|
|
@@ -340,8 +348,8 @@ const getTracingContextData = interaction => {
|
|
|
340
348
|
};
|
|
341
349
|
}
|
|
342
350
|
return tracingContextData;
|
|
343
|
-
};
|
|
344
|
-
function optimizeCustomData(interaction) {
|
|
351
|
+
});
|
|
352
|
+
const optimizeCustomData = withProfiling(function optimizeCustomData(interaction) {
|
|
345
353
|
const {
|
|
346
354
|
customData,
|
|
347
355
|
legacyMetrics
|
|
@@ -377,8 +385,8 @@ function optimizeCustomData(interaction) {
|
|
|
377
385
|
return [...customDataMap.values(), ...legacyMetricsFiltered.values()];
|
|
378
386
|
}
|
|
379
387
|
return [...customDataMap.values()];
|
|
380
|
-
}
|
|
381
|
-
function optimizeReactProfilerTimings(reactProfilerTimings, interactionStart, reactUFOVersion) {
|
|
388
|
+
});
|
|
389
|
+
const optimizeReactProfilerTimings = withProfiling(function optimizeReactProfilerTimings(reactProfilerTimings, interactionStart, reactUFOVersion) {
|
|
382
390
|
const reactProfilerTimingsMap = reactProfilerTimings.reduce((result, {
|
|
383
391
|
labelStack,
|
|
384
392
|
startTime,
|
|
@@ -416,8 +424,8 @@ function optimizeReactProfilerTimings(reactProfilerTimings, interactionStart, re
|
|
|
416
424
|
return result;
|
|
417
425
|
}, new Map());
|
|
418
426
|
return [...reactProfilerTimingsMap.values()];
|
|
419
|
-
}
|
|
420
|
-
function optimizeRedirects(redirects, interactionStart) {
|
|
427
|
+
});
|
|
428
|
+
const optimizeRedirects = withProfiling(function optimizeRedirects(redirects, interactionStart) {
|
|
421
429
|
let lastRedirectTime = interactionStart;
|
|
422
430
|
const updatedRedirects = redirects.sort((a, b) => a.time - b.time).reduce((result, redirect) => {
|
|
423
431
|
const {
|
|
@@ -437,8 +445,8 @@ function optimizeRedirects(redirects, interactionStart) {
|
|
|
437
445
|
return result;
|
|
438
446
|
}, []);
|
|
439
447
|
return updatedRedirects;
|
|
440
|
-
}
|
|
441
|
-
function optimizeHoldInfo(holdInfo, interactionStart, reactUFOVersion) {
|
|
448
|
+
});
|
|
449
|
+
const optimizeHoldInfo = withProfiling(function optimizeHoldInfo(holdInfo, interactionStart, reactUFOVersion) {
|
|
442
450
|
const holdInfoMap = holdInfo.reduce((result, hold) => {
|
|
443
451
|
const {
|
|
444
452
|
labelStack,
|
|
@@ -471,8 +479,8 @@ function optimizeHoldInfo(holdInfo, interactionStart, reactUFOVersion) {
|
|
|
471
479
|
return result;
|
|
472
480
|
}, new Map());
|
|
473
481
|
return [...holdInfoMap.values()];
|
|
474
|
-
}
|
|
475
|
-
function optimizeSpans(spans, interactionStart, reactUFOVersion) {
|
|
482
|
+
});
|
|
483
|
+
const optimizeSpans = withProfiling(function optimizeSpans(spans, interactionStart, reactUFOVersion) {
|
|
476
484
|
const updatedSpans = spans.reduce((result, span) => {
|
|
477
485
|
const {
|
|
478
486
|
labelStack,
|
|
@@ -494,8 +502,8 @@ function optimizeSpans(spans, interactionStart, reactUFOVersion) {
|
|
|
494
502
|
return result;
|
|
495
503
|
}, []);
|
|
496
504
|
return updatedSpans;
|
|
497
|
-
}
|
|
498
|
-
function optimizeRequestInfo(requestInfo, interactionStart, reactUFOVersion) {
|
|
505
|
+
});
|
|
506
|
+
const optimizeRequestInfo = withProfiling(function optimizeRequestInfo(requestInfo, interactionStart, reactUFOVersion) {
|
|
499
507
|
const updatedRequestInfo = requestInfo.reduce((result, reqInfo) => {
|
|
500
508
|
const {
|
|
501
509
|
labelStack,
|
|
@@ -519,8 +527,8 @@ function optimizeRequestInfo(requestInfo, interactionStart, reactUFOVersion) {
|
|
|
519
527
|
return result;
|
|
520
528
|
}, []);
|
|
521
529
|
return updatedRequestInfo;
|
|
522
|
-
}
|
|
523
|
-
function optimizeCustomTimings(customTimings, interactionStart) {
|
|
530
|
+
});
|
|
531
|
+
const optimizeCustomTimings = withProfiling(function optimizeCustomTimings(customTimings, interactionStart) {
|
|
524
532
|
return customTimings.reduce((result, item) => {
|
|
525
533
|
Object.keys(item.data).forEach(key => {
|
|
526
534
|
if (item.data[key].startTime >= interactionStart) {
|
|
@@ -535,8 +543,8 @@ function optimizeCustomTimings(customTimings, interactionStart) {
|
|
|
535
543
|
});
|
|
536
544
|
return result;
|
|
537
545
|
}, []);
|
|
538
|
-
}
|
|
539
|
-
function optimizeMarks(marks, reactUFOVersion) {
|
|
546
|
+
});
|
|
547
|
+
const optimizeMarks = withProfiling(function optimizeMarks(marks, reactUFOVersion) {
|
|
540
548
|
return marks.map(({
|
|
541
549
|
labelStack,
|
|
542
550
|
time,
|
|
@@ -546,8 +554,8 @@ function optimizeMarks(marks, reactUFOVersion) {
|
|
|
546
554
|
labelStack: labelStack && optimizeLabelStack(labelStack, reactUFOVersion),
|
|
547
555
|
time: Math.round(time)
|
|
548
556
|
}));
|
|
549
|
-
}
|
|
550
|
-
function optimizeApdex(apdex, reactUFOVersion) {
|
|
557
|
+
});
|
|
558
|
+
const optimizeApdex = withProfiling(function optimizeApdex(apdex, reactUFOVersion) {
|
|
551
559
|
return apdex.map(({
|
|
552
560
|
stopTime,
|
|
553
561
|
labelStack,
|
|
@@ -559,8 +567,8 @@ function optimizeApdex(apdex, reactUFOVersion) {
|
|
|
559
567
|
labelStack: optimizeLabelStack(labelStack, reactUFOVersion)
|
|
560
568
|
} : {})
|
|
561
569
|
}));
|
|
562
|
-
}
|
|
563
|
-
function objectToArray(obj = {}) {
|
|
570
|
+
});
|
|
571
|
+
const objectToArray = withProfiling(function objectToArray(obj = {}) {
|
|
564
572
|
return Object.keys(obj).reduce((result, key) => {
|
|
565
573
|
result.push({
|
|
566
574
|
label: key,
|
|
@@ -568,8 +576,8 @@ function objectToArray(obj = {}) {
|
|
|
568
576
|
});
|
|
569
577
|
return result;
|
|
570
578
|
}, []);
|
|
571
|
-
}
|
|
572
|
-
function getBM3SubmetricsTimings(submetrics) {
|
|
579
|
+
});
|
|
580
|
+
const getBM3SubmetricsTimings = withProfiling(function getBM3SubmetricsTimings(submetrics) {
|
|
573
581
|
if (!submetrics) {
|
|
574
582
|
return null;
|
|
575
583
|
}
|
|
@@ -590,8 +598,8 @@ function getBM3SubmetricsTimings(submetrics) {
|
|
|
590
598
|
};
|
|
591
599
|
});
|
|
592
600
|
return submetricsTimings;
|
|
593
|
-
}
|
|
594
|
-
function getBm3TrackerTimings(interaction) {
|
|
601
|
+
});
|
|
602
|
+
const getBm3TrackerTimings = withProfiling(function getBm3TrackerTimings(interaction) {
|
|
595
603
|
const interactionLegacyMetrics = interaction.legacyMetrics;
|
|
596
604
|
if (!interactionLegacyMetrics) {
|
|
597
605
|
return {};
|
|
@@ -614,11 +622,11 @@ function getBm3TrackerTimings(interaction) {
|
|
|
614
622
|
return {
|
|
615
623
|
legacyMetrics
|
|
616
624
|
};
|
|
617
|
-
}
|
|
618
|
-
function getPayloadSize(payload) {
|
|
625
|
+
});
|
|
626
|
+
const getPayloadSize = withProfiling(function getPayloadSize(payload) {
|
|
619
627
|
return Math.round(new TextEncoder().encode(JSON.stringify(payload)).length / 1024);
|
|
620
|
-
}
|
|
621
|
-
function getStylesheetMetrics() {
|
|
628
|
+
});
|
|
629
|
+
const getStylesheetMetrics = withProfiling(function getStylesheetMetrics() {
|
|
622
630
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
623
631
|
if (!fg('ufo_capture_stylesheet_metrics')) {
|
|
624
632
|
return {};
|
|
@@ -657,17 +665,18 @@ function getStylesheetMetrics() {
|
|
|
657
665
|
} catch (e) {
|
|
658
666
|
return {};
|
|
659
667
|
}
|
|
660
|
-
}
|
|
668
|
+
});
|
|
661
669
|
let regularTTAI;
|
|
662
670
|
let expTTAI;
|
|
663
|
-
function getErrorCounts(interaction) {
|
|
671
|
+
const getErrorCounts = withProfiling(function getErrorCounts(interaction) {
|
|
664
672
|
return {
|
|
665
673
|
'ufo:errors:globalCount': getGlobalErrorCount(),
|
|
666
674
|
'ufo:errors:count': interaction.errors.length
|
|
667
675
|
};
|
|
668
|
-
}
|
|
676
|
+
});
|
|
669
677
|
async function createInteractionMetricsPayload(interaction, interactionId, experimental) {
|
|
670
678
|
var _window$location, _config$additionalPay;
|
|
679
|
+
const operationTimer = markProfilingStart('createInteractionMetricsPayload');
|
|
671
680
|
const interactionPayloadStart = performance.now();
|
|
672
681
|
const config = getConfig();
|
|
673
682
|
if (!config) {
|
|
@@ -835,7 +844,12 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
|
|
|
835
844
|
'metric:ttai': experimental ? regularTTAI || expTTAI : undefined,
|
|
836
845
|
'metric:experimental:ttai': expTTAI
|
|
837
846
|
},
|
|
838
|
-
'ufo:payloadTime': roundEpsilon(performance.now() - interactionPayloadStart)
|
|
847
|
+
'ufo:payloadTime': roundEpsilon(performance.now() - interactionPayloadStart),
|
|
848
|
+
...(fg('platform_ufo_self_timings') ? {
|
|
849
|
+
'ufo:self:timings:total': getProfilerTotalRuntime(),
|
|
850
|
+
'ufo:self:timings:async': getProfilerAsyncRuntime(),
|
|
851
|
+
'ufo:self:timings:vc': getProfilerRuntimeByTag('vc')
|
|
852
|
+
} : {})
|
|
839
853
|
}
|
|
840
854
|
}
|
|
841
855
|
};
|
|
@@ -843,6 +857,8 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
|
|
|
843
857
|
regularTTAI = undefined;
|
|
844
858
|
expTTAI = undefined;
|
|
845
859
|
}
|
|
860
|
+
markProfilingEnd(operationTimer);
|
|
861
|
+
resetProfilerMeasurements();
|
|
846
862
|
payload.attributes.properties['event:sizeInKb'] = getPayloadSize(payload.attributes.properties);
|
|
847
863
|
return payload;
|
|
848
864
|
}
|
|
@@ -855,7 +871,7 @@ export async function createPayloads(interactionId, interaction) {
|
|
|
855
871
|
const interactionMetricsPayload = await createInteractionMetricsPayload(modifiedInteraction, interactionId);
|
|
856
872
|
return [interactionMetricsPayload];
|
|
857
873
|
}
|
|
858
|
-
export async function createExperimentalMetricsPayload(interactionId, interaction) {
|
|
874
|
+
export const createExperimentalMetricsPayload = withProfiling(async function createExperimentalMetricsPayload(interactionId, interaction) {
|
|
859
875
|
const config = getConfig();
|
|
860
876
|
if (!config) {
|
|
861
877
|
throw Error('UFO Configuration not provided');
|
|
@@ -871,4 +887,4 @@ export async function createExperimentalMetricsPayload(interactionId, interactio
|
|
|
871
887
|
}
|
|
872
888
|
const result = await createInteractionMetricsPayload(interaction, interactionId, true);
|
|
873
889
|
return result;
|
|
874
|
-
}
|
|
890
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { withProfiling } from '../../self-measurements';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Determines the interaction status based on abort reason and BM3 TTI presence.
|
|
3
5
|
*
|
|
@@ -20,7 +22,7 @@
|
|
|
20
22
|
* const result = getInteractionStatus(interaction);
|
|
21
23
|
* // Returns: { originalInteractionStatus: 'SUCCEEDED', overrideStatus: 'SUCCEEDED' }
|
|
22
24
|
*/
|
|
23
|
-
|
|
25
|
+
const getInteractionStatus = withProfiling(function getInteractionStatus(interaction) {
|
|
24
26
|
const originalInteractionStatus = interaction.abortReason ? 'ABORTED' : 'SUCCEEDED';
|
|
25
27
|
const hasBm3TTI = interaction.apdex.length > 0;
|
|
26
28
|
const overrideStatus = hasBm3TTI ? 'SUCCEEDED' : originalInteractionStatus;
|
|
@@ -28,4 +30,5 @@ export default function getInteractionStatus(interaction) {
|
|
|
28
30
|
originalInteractionStatus,
|
|
29
31
|
overrideStatus
|
|
30
32
|
};
|
|
31
|
-
}
|
|
33
|
+
});
|
|
34
|
+
export default getInteractionStatus;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { getPageVisibilityState } from '../../hidden-timing';
|
|
2
|
-
|
|
2
|
+
import { withProfiling } from '../../self-measurements';
|
|
3
|
+
const getPageVisibilityUpToTTAI = withProfiling(function getPageVisibilityUpToTTAI(interaction) {
|
|
3
4
|
const {
|
|
4
5
|
start,
|
|
5
6
|
end
|
|
6
7
|
} = interaction;
|
|
7
8
|
return getPageVisibilityState(start, end);
|
|
8
|
-
}
|
|
9
|
+
});
|
|
10
|
+
export default getPageVisibilityUpToTTAI;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { withProfiling } from '../../self-measurements';
|
|
1
2
|
import * as ssr from '../../ssr';
|
|
2
|
-
|
|
3
|
+
const getSSRDoneTimeValue = withProfiling(function getSSRDoneTimeValue(config) {
|
|
3
4
|
var _config$ssr, _config$ssr2;
|
|
4
5
|
return config !== null && config !== void 0 && (_config$ssr = config.ssr) !== null && _config$ssr !== void 0 && _config$ssr.getSSRDoneTime ? config === null || config === void 0 ? void 0 : (_config$ssr2 = config.ssr) === null || _config$ssr2 === void 0 ? void 0 : _config$ssr2.getSSRDoneTime() : ssr.getSSRDoneTime();
|
|
5
|
-
}
|
|
6
|
+
});
|
|
7
|
+
export default getSSRDoneTimeValue;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { getConfig } from '../../config';
|
|
3
3
|
import { postInteractionLog } from '../../interaction-metrics';
|
|
4
|
+
import { withProfiling } from '../../self-measurements';
|
|
4
5
|
import { getVCObserver } from '../../vc';
|
|
5
6
|
import getInteractionStatus from './get-interaction-status';
|
|
6
7
|
import getPageVisibilityUpToTTAI from './get-page-visibility-up-to-ttai';
|
|
7
8
|
import getSSRDoneTimeValue from './get-ssr-done-time-value';
|
|
8
|
-
|
|
9
|
+
const getVCMetrics = withProfiling(async function getVCMetrics(interaction) {
|
|
9
10
|
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$experimentalI;
|
|
10
11
|
const config = getConfig();
|
|
11
12
|
if (!(config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled)) {
|
|
@@ -64,4 +65,5 @@ export default async function getVCMetrics(interaction) {
|
|
|
64
65
|
'metric:vc90': VC['90']
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
}
|
|
68
|
+
});
|
|
69
|
+
export default getVCMetrics;
|
|
@@ -3,13 +3,14 @@ import { getReactUFOVersion } from '../common/constants';
|
|
|
3
3
|
import { getConfig, getPostInteractionRate } from '../config';
|
|
4
4
|
import { isSegmentLabel, sanitizeUfoName } from '../create-payload/common/utils';
|
|
5
5
|
import { getPageVisibilityState } from '../hidden-timing';
|
|
6
|
-
|
|
6
|
+
import { withProfiling } from '../self-measurements';
|
|
7
|
+
const getParentStack = withProfiling(function getParentStack(labelStack) {
|
|
7
8
|
if (!labelStack || labelStack.length <= 1) {
|
|
8
9
|
return null;
|
|
9
10
|
}
|
|
10
11
|
return labelStack.slice(0, labelStack.length - 1);
|
|
11
|
-
}
|
|
12
|
-
function getSegmentId(labelStack) {
|
|
12
|
+
});
|
|
13
|
+
const getSegmentId = withProfiling(function getSegmentId(labelStack) {
|
|
13
14
|
if (!labelStack) {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
@@ -22,16 +23,16 @@ function getSegmentId(labelStack) {
|
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
24
25
|
return getSegmentId(parentStack);
|
|
25
|
-
}
|
|
26
|
-
function getParentSegmentId(labelStack) {
|
|
26
|
+
});
|
|
27
|
+
const getParentSegmentId = withProfiling(function getParentSegmentId(labelStack) {
|
|
27
28
|
return getSegmentId(getParentStack(labelStack));
|
|
28
|
-
}
|
|
29
|
+
});
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Whenever a render happen, all parent segment have timing reported
|
|
32
33
|
* This method tries to reduce that noise
|
|
33
34
|
*/
|
|
34
|
-
function removeCascadingParentTimingReport(reactProfilerTimings) {
|
|
35
|
+
const removeCascadingParentTimingReport = withProfiling(function removeCascadingParentTimingReport(reactProfilerTimings) {
|
|
35
36
|
const timingIndex = new Map();
|
|
36
37
|
reactProfilerTimings.forEach(timing => {
|
|
37
38
|
const segmentId = getSegmentId(timing.labelStack);
|
|
@@ -57,8 +58,8 @@ function removeCascadingParentTimingReport(reactProfilerTimings) {
|
|
|
57
58
|
}
|
|
58
59
|
});
|
|
59
60
|
return [...timingIndex.values()].flatMap(v => v);
|
|
60
|
-
}
|
|
61
|
-
function transformReactProfilerTimings(reactProfilerTimings) {
|
|
61
|
+
});
|
|
62
|
+
const transformReactProfilerTimings = withProfiling(function transformReactProfilerTimings(reactProfilerTimings) {
|
|
62
63
|
const filtered = removeCascadingParentTimingReport(reactProfilerTimings !== null && reactProfilerTimings !== void 0 ? reactProfilerTimings : []);
|
|
63
64
|
const reactProfilerTimingsMap = filtered.reduce((result, {
|
|
64
65
|
labelStack,
|
|
@@ -97,8 +98,8 @@ function transformReactProfilerTimings(reactProfilerTimings) {
|
|
|
97
98
|
return result;
|
|
98
99
|
}, new Map());
|
|
99
100
|
return [...reactProfilerTimingsMap.values()];
|
|
100
|
-
}
|
|
101
|
-
|
|
101
|
+
});
|
|
102
|
+
const createPostInteractionLogPayload = withProfiling(function createPostInteractionLogPayload({
|
|
102
103
|
lastInteractionFinish,
|
|
103
104
|
reactProfilerTimings,
|
|
104
105
|
lastInteractionFinishVCResult,
|
|
@@ -193,4 +194,5 @@ export default function createPostInteractionLogPayload({
|
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
};
|
|
196
|
-
}
|
|
197
|
+
});
|
|
198
|
+
export default createPostInteractionLogPayload;
|
|
@@ -2,6 +2,7 @@ import { useContext, useMemo } from 'react';
|
|
|
2
2
|
import UFOInteractionContext from '../interaction-context';
|
|
3
3
|
import { getInteractionId } from '../interaction-id-context';
|
|
4
4
|
import { addCustomData } from '../interaction-metrics';
|
|
5
|
+
import { withProfiling } from '../self-measurements';
|
|
5
6
|
export default function UFOCustomData({
|
|
6
7
|
data
|
|
7
8
|
}) {
|
|
@@ -14,11 +15,11 @@ export default function UFOCustomData({
|
|
|
14
15
|
}, [data, interactionContext]);
|
|
15
16
|
return null;
|
|
16
17
|
}
|
|
17
|
-
export function addUFOCustomData(data) {
|
|
18
|
+
export const addUFOCustomData = withProfiling(function addUFOCustomData(data) {
|
|
18
19
|
const interactionId = getInteractionId();
|
|
19
20
|
const currentInteractionId = interactionId.current;
|
|
20
21
|
if (!currentInteractionId) {
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
24
|
addCustomData(currentInteractionId, [], data);
|
|
24
|
-
}
|
|
25
|
+
});
|
|
@@ -2,6 +2,7 @@ import { useContext, useMemo } from 'react';
|
|
|
2
2
|
import UFOInteractionContext from '../interaction-context';
|
|
3
3
|
import { getInteractionId } from '../interaction-id-context';
|
|
4
4
|
import { addMark } from '../interaction-metrics';
|
|
5
|
+
import { withProfiling } from '../self-measurements';
|
|
5
6
|
export default function UFOCustomMark({
|
|
6
7
|
name,
|
|
7
8
|
timestamp
|
|
@@ -27,7 +28,7 @@ export function UFOCustomMarks({
|
|
|
27
28
|
}, [data, interactionContext]);
|
|
28
29
|
return null;
|
|
29
30
|
}
|
|
30
|
-
export function addUFOCustomMark(name, timestamp) {
|
|
31
|
+
export const addUFOCustomMark = withProfiling(function addUFOCustomMark(name, timestamp) {
|
|
31
32
|
const interactionId = getInteractionId();
|
|
32
33
|
const currentInteractionId = interactionId.current;
|
|
33
34
|
if (!currentInteractionId) {
|
|
@@ -35,4 +36,4 @@ export function addUFOCustomMark(name, timestamp) {
|
|
|
35
36
|
}
|
|
36
37
|
const time = timestamp || performance.now();
|
|
37
38
|
addMark(currentInteractionId, 'custom', name, [], time);
|
|
38
|
-
}
|
|
39
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { addSpanToAll } from '../interaction-metrics';
|
|
2
|
-
|
|
2
|
+
import { withProfiling } from '../self-measurements';
|
|
3
|
+
export const addCustomSpans = withProfiling(function addCustomSpans(name, start, end = performance.now(), size = 0) {
|
|
3
4
|
addSpanToAll('custom', name, [{
|
|
4
5
|
name: 'custom'
|
|
5
6
|
}], start, end, size);
|
|
6
|
-
}
|
|
7
|
+
});
|
|
@@ -2,7 +2,8 @@ import { useContext, useMemo } from 'react';
|
|
|
2
2
|
import UFOInteractionContext from '../interaction-context';
|
|
3
3
|
import { getInteractionId } from '../interaction-id-context';
|
|
4
4
|
import { addCustomTiming, getCurrentInteractionType } from '../interaction-metrics';
|
|
5
|
-
|
|
5
|
+
import { withProfiling } from '../self-measurements';
|
|
6
|
+
export const getBm3Timings = withProfiling(function getBm3Timings(marks, timingConfigs) {
|
|
6
7
|
const bm3Timings = {};
|
|
7
8
|
if (!marks || !timingConfigs) {
|
|
8
9
|
return bm3Timings;
|
|
@@ -25,7 +26,7 @@ export function getBm3Timings(marks, timingConfigs) {
|
|
|
25
26
|
};
|
|
26
27
|
});
|
|
27
28
|
return bm3Timings;
|
|
28
|
-
}
|
|
29
|
+
});
|
|
29
30
|
export function UFOBM3TimingsToUFO({
|
|
30
31
|
marks,
|
|
31
32
|
timings
|
|
@@ -44,7 +45,7 @@ export function UFOBM3TimingsToUFO({
|
|
|
44
45
|
}, [interactionContext, interactionId, marks, timings]);
|
|
45
46
|
return null;
|
|
46
47
|
}
|
|
47
|
-
export function addBM3TimingsToUFO(marks, timingsConfig) {
|
|
48
|
+
export const addBM3TimingsToUFO = withProfiling(function addBM3TimingsToUFO(marks, timingsConfig) {
|
|
48
49
|
const interactionId = getInteractionId().current;
|
|
49
50
|
if (interactionId) {
|
|
50
51
|
const interactionType = getCurrentInteractionType(interactionId);
|
|
@@ -54,4 +55,4 @@ export function addBM3TimingsToUFO(marks, timingsConfig) {
|
|
|
54
55
|
const bm3Timings = getBm3Timings(marks, timingsConfig);
|
|
55
56
|
addCustomTiming(interactionId, [], bm3Timings);
|
|
56
57
|
}
|
|
57
|
-
}
|
|
58
|
+
});
|