@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { roundEpsilon } from '../../../round-number';
|
|
2
|
+
import { withProfiling } from '../../../self-measurements';
|
|
2
3
|
const getPerformanceObject = () => {
|
|
3
4
|
var _window;
|
|
4
5
|
return ((_window = window) !== null && _window !== void 0 ? _window : {}).performance;
|
|
@@ -11,7 +12,7 @@ export const resourceTimingBuffer = {
|
|
|
11
12
|
timings: [],
|
|
12
13
|
maxSize: 1000,
|
|
13
14
|
observer: null,
|
|
14
|
-
transformResource: entry
|
|
15
|
+
transformResource: withProfiling(function transformResource(entry) {
|
|
15
16
|
var _entry$serverTiming, _entry$serverTiming2;
|
|
16
17
|
const duration = roundEpsilon(entry.duration);
|
|
17
18
|
|
|
@@ -36,8 +37,8 @@ export const resourceTimingBuffer = {
|
|
|
36
37
|
encodedSize: roundEpsilon(entry.encodedBodySize),
|
|
37
38
|
decodedSize: roundEpsilon(entry.decodedBodySize)
|
|
38
39
|
};
|
|
39
|
-
},
|
|
40
|
-
start: ()
|
|
40
|
+
}),
|
|
41
|
+
start: withProfiling(function start() {
|
|
41
42
|
var _performance$getEntri;
|
|
42
43
|
const performance = getPerformanceObject();
|
|
43
44
|
const PerformanceObserver = getPerformanceObserverObject();
|
|
@@ -55,15 +56,15 @@ export const resourceTimingBuffer = {
|
|
|
55
56
|
resourceTimingBuffer.observer.observe({
|
|
56
57
|
entryTypes: ['resource']
|
|
57
58
|
});
|
|
58
|
-
},
|
|
59
|
-
stop: ()
|
|
59
|
+
}),
|
|
60
|
+
stop: withProfiling(function stop() {
|
|
60
61
|
if (resourceTimingBuffer.observer) {
|
|
61
62
|
resourceTimingBuffer.observer.disconnect();
|
|
62
63
|
resourceTimingBuffer.observer = null;
|
|
63
64
|
}
|
|
64
65
|
resourceTimingBuffer.timings = [];
|
|
65
|
-
},
|
|
66
|
-
addTimings: list
|
|
66
|
+
}),
|
|
67
|
+
addTimings: withProfiling(function addTimings(list) {
|
|
67
68
|
const entries = list.getEntries().map(entry => resourceTimingBuffer.transformResource(entry));
|
|
68
69
|
const overflow = resourceTimingBuffer.timings.length + entries.length;
|
|
69
70
|
if (overflow > resourceTimingBuffer.maxSize) {
|
|
@@ -71,10 +72,12 @@ export const resourceTimingBuffer = {
|
|
|
71
72
|
resourceTimingBuffer.timings.splice(0, fieldsToRemove);
|
|
72
73
|
}
|
|
73
74
|
resourceTimingBuffer.timings.push(...entries);
|
|
74
|
-
}
|
|
75
|
+
})
|
|
75
76
|
};
|
|
76
|
-
const isValidTiming = (timing, startTime, endTime)
|
|
77
|
-
|
|
77
|
+
const isValidTiming = withProfiling(function isValidTiming(timing, startTime, endTime) {
|
|
78
|
+
return timing.startTime >= startTime && timing.startTime + timing.duration <= endTime;
|
|
79
|
+
});
|
|
80
|
+
export const filterResourceTimings = withProfiling(function filterResourceTimings(startTime, endTime) {
|
|
78
81
|
const performance = getPerformanceObject();
|
|
79
82
|
const PerformanceObserver = getPerformanceObserverObject();
|
|
80
83
|
if (!PerformanceObserver || !resourceTimingBuffer.observer) {
|
|
@@ -85,4 +88,4 @@ export const filterResourceTimings = (startTime, endTime) => {
|
|
|
85
88
|
return null;
|
|
86
89
|
}
|
|
87
90
|
return resourceTimingBuffer.timings.filter(timing => isValidTiming(timing, startTime, endTime));
|
|
88
|
-
};
|
|
91
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { getConfig as getConfigUFO } from '../config';
|
|
3
3
|
import { roundEpsilon } from '../round-number';
|
|
4
|
+
import { withProfiling } from '../self-measurements';
|
|
4
5
|
import { getConfig } from './common/utils/config';
|
|
5
6
|
import { filterResourceTimings } from './common/utils/resource-timing-buffer';
|
|
6
7
|
const alwaysCacheableTypes = ['script', 'link'];
|
|
@@ -8,18 +9,20 @@ const resourceTypes = ['fetch', 'xmlhttprequest'];
|
|
|
8
9
|
const CACHE_NETWORK = 'network';
|
|
9
10
|
const CACHE_MEMORY = 'memory';
|
|
10
11
|
const CACHE_DISK = 'disk';
|
|
11
|
-
const isCacheableType = (url, type)
|
|
12
|
+
const isCacheableType = withProfiling(function isCacheableType(url, type) {
|
|
12
13
|
if (alwaysCacheableTypes.includes(type)) {
|
|
13
14
|
return true;
|
|
14
15
|
}
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
15
18
|
if (type === 'other' && url.includes('.js') && fg('ufo_support_other_resource_type_js')) {
|
|
16
19
|
return true;
|
|
17
20
|
}
|
|
18
21
|
return false;
|
|
19
|
-
};
|
|
22
|
+
});
|
|
20
23
|
|
|
21
24
|
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
22
|
-
const calculateTransferType = (name, type, duration, size)
|
|
25
|
+
const calculateTransferType = withProfiling(function calculateTransferType(name, type, duration, size) {
|
|
23
26
|
if (!isCacheableType(name, type)) {
|
|
24
27
|
return CACHE_NETWORK;
|
|
25
28
|
}
|
|
@@ -33,12 +36,17 @@ const calculateTransferType = (name, type, duration, size) => {
|
|
|
33
36
|
return null;
|
|
34
37
|
}
|
|
35
38
|
return CACHE_NETWORK;
|
|
36
|
-
};
|
|
37
|
-
const getWindowObject = ()
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
});
|
|
40
|
+
const getWindowObject = withProfiling(function getWindowObject() {
|
|
41
|
+
return typeof window !== 'undefined' && !!window ? window : undefined;
|
|
42
|
+
});
|
|
43
|
+
const hasAccessToResourceSize = withProfiling(function hasAccessToResourceSize(url, type, entry, hasTimingHeaders) {
|
|
44
|
+
return !isCacheableType(url, type) || url.includes('localhost') || !!getWindowObject() && url.includes(window.location.hostname) || hasTimingHeaders(url, entry);
|
|
45
|
+
});
|
|
46
|
+
const getReportedInitiatorTypes = withProfiling(function getReportedInitiatorTypes(xhrEnabled) {
|
|
40
47
|
const ufoConfig = getConfigUFO();
|
|
41
48
|
if (!(ufoConfig !== null && ufoConfig !== void 0 && ufoConfig.allowedResources)) {
|
|
49
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
42
50
|
if (fg('ufo_support_other_resource_type_js')) {
|
|
43
51
|
if (xhrEnabled) {
|
|
44
52
|
return ['script', 'link', 'fetch', 'other', 'xmlhttprequest'];
|
|
@@ -52,14 +60,18 @@ const getReportedInitiatorTypes = xhrEnabled => {
|
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
62
|
return ufoConfig.allowedResources;
|
|
55
|
-
};
|
|
56
|
-
const evaluateAccessToResourceTimings = (url, entry)
|
|
63
|
+
});
|
|
64
|
+
const evaluateAccessToResourceTimings = withProfiling(function evaluateAccessToResourceTimings(url, entry) {
|
|
65
|
+
return !(entry.responseStart === 0 && entry.startTime > entry.responseStart);
|
|
66
|
+
});
|
|
57
67
|
|
|
58
68
|
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
59
|
-
const getSizeObject =
|
|
60
|
-
size
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
const getSizeObject = withProfiling(function getSizeObject(size) {
|
|
70
|
+
return size !== undefined ? {
|
|
71
|
+
size
|
|
72
|
+
} : null;
|
|
73
|
+
});
|
|
74
|
+
const getNetworkData = withProfiling(function getNetworkData(item, eventStart, hasTimingHeaders = evaluateAccessToResourceTimings) {
|
|
63
75
|
const {
|
|
64
76
|
name,
|
|
65
77
|
duration,
|
|
@@ -95,8 +107,8 @@ const getNetworkData = (item, eventStart, hasTimingHeaders = evaluateAccessToRes
|
|
|
95
107
|
requestStart,
|
|
96
108
|
...getSizeObject(transferSize)
|
|
97
109
|
};
|
|
98
|
-
};
|
|
99
|
-
export const getResourceTimings = (interactionStart, interactionEnd)
|
|
110
|
+
});
|
|
111
|
+
export const getResourceTimings = withProfiling(function getResourceTimings(interactionStart, interactionEnd) {
|
|
100
112
|
const resourceTiming = {};
|
|
101
113
|
if (interactionStart === null) {
|
|
102
114
|
return resourceTiming;
|
|
@@ -130,7 +142,9 @@ export const getResourceTimings = (interactionStart, interactionEnd) => {
|
|
|
130
142
|
if (initiatorType === 'xmlhttprequest' && (xhrFilter === undefined || xhrFilter(name) === false)) {
|
|
131
143
|
return;
|
|
132
144
|
}
|
|
133
|
-
if (initiatorType === 'other' && !name.includes('.js') &&
|
|
145
|
+
if (initiatorType === 'other' && !name.includes('.js') &&
|
|
146
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
147
|
+
fg('ufo_support_other_resource_type_js')) {
|
|
134
148
|
return;
|
|
135
149
|
}
|
|
136
150
|
const url = resourceTypes.includes(initiatorType) ? sanitiseEndpoints(name) : mapResources(name);
|
|
@@ -151,4 +165,4 @@ export const getResourceTimings = (interactionStart, interactionEnd) => {
|
|
|
151
165
|
};
|
|
152
166
|
});
|
|
153
167
|
return resourceTiming;
|
|
154
|
-
};
|
|
168
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
1
2
|
import { resourceTimingBuffer } from './common/utils/resource-timing-buffer';
|
|
2
|
-
export function startResourceTimingBuffer() {
|
|
3
|
+
export const startResourceTimingBuffer = withProfiling(function startResourceTimingBuffer() {
|
|
3
4
|
resourceTimingBuffer.start();
|
|
4
|
-
}
|
|
5
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
export const roundEpsilon = withProfiling(function roundEpsilon(num, places = 3) {
|
|
2
3
|
const factor = Math.pow(10, places);
|
|
3
4
|
return Math.round((num + Number.EPSILON) * factor) / factor;
|
|
4
|
-
};
|
|
5
|
+
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
const getUFORouteName = withProfiling(function getUFORouteName(route) {
|
|
2
3
|
if (route.ufoName != null) {
|
|
3
4
|
return route.ufoName;
|
|
4
5
|
}
|
|
5
6
|
return route.name;
|
|
6
|
-
}
|
|
7
|
+
});
|
|
8
|
+
export default getUFORouteName;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
const scheduleOnPaint = withProfiling(function scheduleOnPaint(_callback) {
|
|
2
3
|
var _document;
|
|
4
|
+
const callback = withProfiling(_callback);
|
|
3
5
|
if (((_document = document) === null || _document === void 0 ? void 0 : _document.visibilityState) !== 'visible') {
|
|
4
6
|
// last resort fallback
|
|
5
7
|
setTimeout(callback, 100);
|
|
@@ -26,4 +28,5 @@ export default function scheduleOnPaint(callback) {
|
|
|
26
28
|
});
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
|
-
}
|
|
31
|
+
});
|
|
32
|
+
export default scheduleOnPaint;
|
|
@@ -9,6 +9,7 @@ import UFOInteractionContext from '../interaction-context';
|
|
|
9
9
|
import UFOInteractionIDContext from '../interaction-id-context';
|
|
10
10
|
import { abortByNewInteraction, addApdex, addCustomData, addCustomTiming, addHold, addHoldByID, addMark, addNewInteraction, addProfilerTimings, addRequestInfo, addSegment, addSpan, removeHoldByID, removeSegment, tryComplete } from '../interaction-metrics';
|
|
11
11
|
import UFORouteName from '../route-name-context';
|
|
12
|
+
import { withProfiling } from '../self-measurements';
|
|
12
13
|
import generateId from '../short-id';
|
|
13
14
|
import scheduleOnPaint from './schedule-on-paint';
|
|
14
15
|
let tryCompleteHandle;
|
|
@@ -17,6 +18,7 @@ const AsyncSegmentHighlight = /*#__PURE__*/lazy(() => import( /* webpackChunkNam
|
|
|
17
18
|
})));
|
|
18
19
|
const noopIdMap = new Map();
|
|
19
20
|
|
|
21
|
+
// KARL TODO: finish self profiling
|
|
20
22
|
/** A portion of the page we apply measurement to */
|
|
21
23
|
export default function UFOSegment({
|
|
22
24
|
name: segmentName,
|
|
@@ -58,11 +60,12 @@ export default function UFOSegment({
|
|
|
58
60
|
}], [parentContext, segmentName, segmentId]);
|
|
59
61
|
const interactionId = useContext(UFOInteractionIDContext);
|
|
60
62
|
const interactionContext = useMemo(() => {
|
|
63
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
61
64
|
if (!fg('platform-ufo-add-segment-use-effect')) {
|
|
62
65
|
addSegment(labelStack);
|
|
63
66
|
}
|
|
64
67
|
let lastCompleteEndTime = 0;
|
|
65
|
-
function complete(endTime = performance.now()) {
|
|
68
|
+
const complete = withProfiling(function complete(endTime = performance.now()) {
|
|
66
69
|
if (interactionId.current) {
|
|
67
70
|
if (parentContext) {
|
|
68
71
|
parentContext.complete();
|
|
@@ -75,7 +78,7 @@ export default function UFOSegment({
|
|
|
75
78
|
var _cancelAnimationFrame;
|
|
76
79
|
(_cancelAnimationFrame = cancelAnimationFrame) === null || _cancelAnimationFrame === void 0 ? void 0 : _cancelAnimationFrame(tryCompleteHandle);
|
|
77
80
|
}
|
|
78
|
-
|
|
81
|
+
const onComplete = withProfiling(function onComplete() {
|
|
79
82
|
if (capturedInteractionId === interactionId.current) {
|
|
80
83
|
var _document;
|
|
81
84
|
const isPageVisible = ((_document = document) === null || _document === void 0 ? void 0 : _document.visibilityState) === 'visible';
|
|
@@ -93,9 +96,10 @@ export default function UFOSegment({
|
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
});
|
|
99
|
+
scheduleCallback(NormalPriority, onComplete);
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
|
-
}
|
|
102
|
+
});
|
|
99
103
|
function _internalHold(labelStack, name, experimental = false) {
|
|
100
104
|
if (interactionId.current != null) {
|
|
101
105
|
if (parentContext) {
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
globalThis.__ufo_self_measurements = globalThis.__ufo_self_measurements || {
|
|
3
|
+
__internalState: {
|
|
4
|
+
functionStack: []
|
|
5
|
+
},
|
|
6
|
+
runtime: {
|
|
7
|
+
total: 0,
|
|
8
|
+
async: 0,
|
|
9
|
+
error: 0,
|
|
10
|
+
byFunction: {},
|
|
11
|
+
custom: {}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export function resetProfilerMeasurements() {
|
|
15
|
+
globalThis.__ufo_self_measurements = {
|
|
16
|
+
__internalState: {
|
|
17
|
+
functionStack: []
|
|
18
|
+
},
|
|
19
|
+
runtime: {
|
|
20
|
+
total: 0,
|
|
21
|
+
async: 0,
|
|
22
|
+
error: 0,
|
|
23
|
+
byFunction: {},
|
|
24
|
+
custom: {}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function trackFunctionTimingStart(fnName) {
|
|
29
|
+
var _globalThis$__ufo_sel, _globalThis$__ufo_sel2, _globalThis$__ufo_sel3;
|
|
30
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
31
|
+
resetProfilerMeasurements();
|
|
32
|
+
}
|
|
33
|
+
globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$__ufo_sel = globalThis.__ufo_self_measurements) === null || _globalThis$__ufo_sel === void 0 ? void 0 : (_globalThis$__ufo_sel2 = _globalThis$__ufo_sel.__internalState) === null || _globalThis$__ufo_sel2 === void 0 ? void 0 : (_globalThis$__ufo_sel3 = _globalThis$__ufo_sel2.functionStack) === null || _globalThis$__ufo_sel3 === void 0 ? void 0 : _globalThis$__ufo_sel3.push(fnName);
|
|
34
|
+
}
|
|
35
|
+
function trackFunctionTimingEnd() {
|
|
36
|
+
var _globalThis$__ufo_sel4, _globalThis$__ufo_sel5, _globalThis$__ufo_sel6;
|
|
37
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
38
|
+
resetProfilerMeasurements();
|
|
39
|
+
}
|
|
40
|
+
globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$__ufo_sel4 = globalThis.__ufo_self_measurements) === null || _globalThis$__ufo_sel4 === void 0 ? void 0 : (_globalThis$__ufo_sel5 = _globalThis$__ufo_sel4.__internalState) === null || _globalThis$__ufo_sel5 === void 0 ? void 0 : (_globalThis$__ufo_sel6 = _globalThis$__ufo_sel5.functionStack) === null || _globalThis$__ufo_sel6 === void 0 ? void 0 : _globalThis$__ufo_sel6.pop();
|
|
41
|
+
}
|
|
42
|
+
function shouldRecordProfilerMeasurement() {
|
|
43
|
+
var _globalThis$__ufo_sel7, _globalThis$__ufo_sel8, _globalThis$__ufo_sel9;
|
|
44
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
45
|
+
resetProfilerMeasurements();
|
|
46
|
+
}
|
|
47
|
+
return (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$__ufo_sel7 = globalThis.__ufo_self_measurements) === null || _globalThis$__ufo_sel7 === void 0 ? void 0 : (_globalThis$__ufo_sel8 = _globalThis$__ufo_sel7.__internalState) === null || _globalThis$__ufo_sel8 === void 0 ? void 0 : (_globalThis$__ufo_sel9 = _globalThis$__ufo_sel8.functionStack) === null || _globalThis$__ufo_sel9 === void 0 ? void 0 : _globalThis$__ufo_sel9.length) === 0;
|
|
48
|
+
}
|
|
49
|
+
function recordProfilerMeasurement(functionName, duration, isAsync, isError, tags = []) {
|
|
50
|
+
// discard measurements that are not significant
|
|
51
|
+
if (duration <= 0) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
55
|
+
resetProfilerMeasurements();
|
|
56
|
+
}
|
|
57
|
+
globalThis.__ufo_self_measurements.runtime.total += duration;
|
|
58
|
+
if (isAsync) {
|
|
59
|
+
globalThis.__ufo_self_measurements.runtime.async += duration;
|
|
60
|
+
}
|
|
61
|
+
if (isError) {
|
|
62
|
+
globalThis.__ufo_self_measurements.runtime.error += duration;
|
|
63
|
+
}
|
|
64
|
+
if (functionName in globalThis.__ufo_self_measurements.runtime.byFunction) {
|
|
65
|
+
globalThis.__ufo_self_measurements.runtime.byFunction[functionName] += duration;
|
|
66
|
+
} else {
|
|
67
|
+
globalThis.__ufo_self_measurements.runtime.byFunction[functionName] = duration;
|
|
68
|
+
}
|
|
69
|
+
for (const tag of tags) {
|
|
70
|
+
if (tag in globalThis.__ufo_self_measurements.runtime.custom) {
|
|
71
|
+
globalThis.__ufo_self_measurements.runtime.custom[tag] += duration;
|
|
72
|
+
} else {
|
|
73
|
+
globalThis.__ufo_self_measurements.runtime.custom[tag] = duration;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function isPromise(value) {
|
|
78
|
+
return value && typeof value.then === 'function';
|
|
79
|
+
}
|
|
80
|
+
export function withProfiling(fn, tags = []) {
|
|
81
|
+
try {
|
|
82
|
+
if (!fg('platform_ufo_self_timings')) {
|
|
83
|
+
return fn; // this is a NOOP wrapper if feature gate is disabled
|
|
84
|
+
}
|
|
85
|
+
} catch {
|
|
86
|
+
return fn;
|
|
87
|
+
}
|
|
88
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
89
|
+
return fn;
|
|
90
|
+
}
|
|
91
|
+
if (fn.constructor.name === 'AsyncFunction') {
|
|
92
|
+
return async function (...args) {
|
|
93
|
+
var _fn$name;
|
|
94
|
+
const startTime = performance.now();
|
|
95
|
+
trackFunctionTimingStart((_fn$name = fn.name) !== null && _fn$name !== void 0 ? _fn$name : 'anonymous');
|
|
96
|
+
try {
|
|
97
|
+
const result = await fn(...args);
|
|
98
|
+
const endTime = performance.now();
|
|
99
|
+
trackFunctionTimingEnd();
|
|
100
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
101
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, true, false, tags);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
} catch (error) {
|
|
105
|
+
const endTime = performance.now();
|
|
106
|
+
trackFunctionTimingEnd();
|
|
107
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
108
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, true, true, tags);
|
|
109
|
+
}
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return function (...args) {
|
|
115
|
+
var _fn$name2;
|
|
116
|
+
const startTime = performance.now();
|
|
117
|
+
trackFunctionTimingStart((_fn$name2 = fn.name) !== null && _fn$name2 !== void 0 ? _fn$name2 : 'anonymous');
|
|
118
|
+
try {
|
|
119
|
+
const result = fn(...args);
|
|
120
|
+
if (isPromise(result)) {
|
|
121
|
+
result.then(value => {
|
|
122
|
+
const endTime = performance.now();
|
|
123
|
+
trackFunctionTimingEnd();
|
|
124
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
125
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, true, false, tags);
|
|
126
|
+
}
|
|
127
|
+
return value;
|
|
128
|
+
}).catch(value => {
|
|
129
|
+
const endTime = performance.now();
|
|
130
|
+
trackFunctionTimingEnd();
|
|
131
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
132
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, true, true, tags);
|
|
133
|
+
}
|
|
134
|
+
return value;
|
|
135
|
+
});
|
|
136
|
+
} else {
|
|
137
|
+
const endTime = performance.now();
|
|
138
|
+
trackFunctionTimingEnd();
|
|
139
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
140
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, false, false, tags);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return result;
|
|
144
|
+
} catch (error) {
|
|
145
|
+
const endTime = performance.now();
|
|
146
|
+
trackFunctionTimingEnd();
|
|
147
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
148
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, false, true, tags);
|
|
149
|
+
}
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export function markProfilingStart(name) {
|
|
155
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
156
|
+
return {
|
|
157
|
+
name,
|
|
158
|
+
startTime: -1
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
trackFunctionTimingStart(name);
|
|
162
|
+
return {
|
|
163
|
+
name,
|
|
164
|
+
startTime: performance.now()
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export function markProfilingEnd({
|
|
168
|
+
name,
|
|
169
|
+
startTime
|
|
170
|
+
}, {
|
|
171
|
+
isAsync,
|
|
172
|
+
isError,
|
|
173
|
+
tags
|
|
174
|
+
} = {}) {
|
|
175
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
trackFunctionTimingEnd();
|
|
179
|
+
if (!fg('platform_ufo_self_timings')) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const endTime = performance.now();
|
|
183
|
+
recordProfilerMeasurement(name, endTime - startTime, isAsync, isError, tags);
|
|
184
|
+
}
|
|
185
|
+
export function getProfilerData() {
|
|
186
|
+
return {
|
|
187
|
+
...(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime)
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
export function getProfilerTotalRuntime() {
|
|
191
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.total) === 'number') {
|
|
192
|
+
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.total);
|
|
193
|
+
}
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
export function getProfilerAsyncRuntime() {
|
|
197
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.async) === 'number') {
|
|
198
|
+
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.async);
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
export function getProfilerRuntimeByFunction(functionName) {
|
|
203
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.byFunction[functionName]) === 'number') {
|
|
204
|
+
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.byFunction[functionName]);
|
|
205
|
+
}
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
export function getProfilerRuntimeByTag(tag) {
|
|
209
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.custom[tag]) === 'number') {
|
|
210
|
+
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.custom[tag]);
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addError, getActiveInteraction } from '../interaction-metrics';
|
|
2
|
-
|
|
2
|
+
import { withProfiling } from '../self-measurements';
|
|
3
|
+
export const setInteractionError = withProfiling(function setInteractionError(interactionName, error) {
|
|
3
4
|
const interaction = getActiveInteraction();
|
|
4
5
|
if (!interaction) {
|
|
5
6
|
return;
|
|
@@ -8,4 +9,4 @@ export function setInteractionError(interactionName, error) {
|
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
11
|
addError(interaction.id, error.name, null, 'Manual interaction error', error.errorMessage, undefined, true);
|
|
11
|
-
}
|
|
12
|
+
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
const generateId = withProfiling(function generateId(length = 7) {
|
|
2
3
|
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
3
4
|
let result = '';
|
|
4
5
|
for (let i = 0; i < length; i++) {
|
|
5
6
|
result += characters.charAt(Math.floor(Math.random() * characters.length));
|
|
6
7
|
}
|
|
7
8
|
return result;
|
|
8
|
-
}
|
|
9
|
+
});
|
|
10
|
+
export default generateId;
|
package/dist/es2019/ssr/index.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
1
2
|
const NESTED_METRIC_SEPARATOR = '/';
|
|
2
|
-
const filterEntry =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const filterEntry = withProfiling(function filterEntry(entry) {
|
|
4
|
+
return !(!entry || typeof entry !== 'object' || entry.startTime < 0 || entry.duration < 0);
|
|
5
|
+
});
|
|
6
|
+
const mapEntry = withProfiling(function mapEntry(entry) {
|
|
7
|
+
return {
|
|
8
|
+
startTime: Math.round(entry.startTime),
|
|
9
|
+
duration: Math.round(entry.duration)
|
|
10
|
+
};
|
|
6
11
|
});
|
|
7
12
|
const SSR_PREFIX = 'ssr';
|
|
8
|
-
const mapKey = key
|
|
13
|
+
const mapKey = withProfiling(function mapKey(key) {
|
|
9
14
|
if (key === 'total') {
|
|
10
15
|
return SSR_PREFIX;
|
|
11
16
|
}
|
|
12
17
|
return `${SSR_PREFIX}${NESTED_METRIC_SEPARATOR}${key}`;
|
|
13
|
-
};
|
|
18
|
+
});
|
|
14
19
|
let config;
|
|
15
|
-
export function configure(ssrConfig) {
|
|
20
|
+
export const configure = withProfiling(function configure(ssrConfig) {
|
|
16
21
|
config = ssrConfig;
|
|
17
|
-
}
|
|
18
|
-
export function getSSRTimings() {
|
|
22
|
+
});
|
|
23
|
+
export const getSSRTimings = withProfiling(function getSSRTimings() {
|
|
19
24
|
var _config;
|
|
20
25
|
if (!((_config = config) !== null && _config !== void 0 && _config.getTimings)) {
|
|
21
26
|
return {};
|
|
@@ -31,16 +36,16 @@ export function getSSRTimings() {
|
|
|
31
36
|
return acc;
|
|
32
37
|
}, {});
|
|
33
38
|
return ssrTimings;
|
|
34
|
-
}
|
|
35
|
-
export function getSSRSuccess() {
|
|
39
|
+
});
|
|
40
|
+
export const getSSRSuccess = withProfiling(function getSSRSuccess() {
|
|
36
41
|
var _config2;
|
|
37
42
|
return !!((_config2 = config) !== null && _config2 !== void 0 && _config2.getDoneMark());
|
|
38
|
-
}
|
|
39
|
-
export function getSSRDoneTime() {
|
|
43
|
+
});
|
|
44
|
+
export const getSSRDoneTime = withProfiling(function getSSRDoneTime() {
|
|
40
45
|
var _config$getDoneMark, _config3;
|
|
41
46
|
return (_config$getDoneMark = (_config3 = config) === null || _config3 === void 0 ? void 0 : _config3.getDoneMark()) !== null && _config$getDoneMark !== void 0 ? _config$getDoneMark : undefined;
|
|
42
|
-
}
|
|
43
|
-
export function getSSRFeatureFlags() {
|
|
47
|
+
});
|
|
48
|
+
export const getSSRFeatureFlags = withProfiling(function getSSRFeatureFlags() {
|
|
44
49
|
var _config4;
|
|
45
50
|
if (!((_config4 = config) !== null && _config4 !== void 0 && _config4.getFeatureFlags)) {
|
|
46
51
|
return undefined;
|
|
@@ -51,4 +56,4 @@ export function getSSRFeatureFlags() {
|
|
|
51
56
|
// eslint-disable-next-line no-empty
|
|
52
57
|
} catch (e) {}
|
|
53
58
|
return undefined;
|
|
54
|
-
}
|
|
59
|
+
});
|
|
@@ -4,7 +4,8 @@ import { getDoNotAbortActivePressInteraction, getInteractionRate } from '../conf
|
|
|
4
4
|
import { DefaultInteractionID } from '../interaction-id-context';
|
|
5
5
|
import { abortAll, addNewInteraction, getActiveInteraction } from '../interaction-metrics';
|
|
6
6
|
import UFORouteName from '../route-name-context';
|
|
7
|
-
|
|
7
|
+
import { withProfiling } from '../self-measurements';
|
|
8
|
+
const mapToInteractionType = withProfiling(function mapToInteractionType(eventType) {
|
|
8
9
|
if (eventType === 'click' || eventType === 'dblclick' || eventType === 'mousedown') {
|
|
9
10
|
return 'press';
|
|
10
11
|
}
|
|
@@ -12,8 +13,8 @@ function mapToInteractionType(eventType) {
|
|
|
12
13
|
return 'hover';
|
|
13
14
|
}
|
|
14
15
|
return undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
16
|
+
});
|
|
17
|
+
const traceUFOInteraction = withProfiling(function traceUFOInteraction(name, event) {
|
|
17
18
|
if (!event || !event.isTrusted) {
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
@@ -38,4 +39,5 @@ export default function traceUFOInteraction(name, event) {
|
|
|
38
39
|
DefaultInteractionID.current = newId;
|
|
39
40
|
addNewInteraction(newId, name, 'press', startTimestamp, rate, [], UFORouteName.current);
|
|
40
41
|
}
|
|
41
|
-
}
|
|
42
|
+
});
|
|
43
|
+
export default traceUFOInteraction;
|
|
@@ -5,8 +5,9 @@ import { getActiveTrace } from '../experience-trace-id-context';
|
|
|
5
5
|
import { DefaultInteractionID } from '../interaction-id-context';
|
|
6
6
|
import { abort, addHoldByID, addNewInteraction, getActiveInteraction, removeHoldByID, updatePageLoadInteractionName } from '../interaction-metrics';
|
|
7
7
|
import UFORouteName from '../route-name-context';
|
|
8
|
+
import { withProfiling } from '../self-measurements';
|
|
8
9
|
const AWAITING_PAGELOAD_NAME = 'awaiting_pageload_name';
|
|
9
|
-
|
|
10
|
+
const traceUFOPageLoad = withProfiling(function traceUFOPageLoad(ufoName, routeName = ufoName) {
|
|
10
11
|
const activeInteraction = getActiveInteraction();
|
|
11
12
|
if (activeInteraction && !ufoName) {
|
|
12
13
|
return;
|
|
@@ -29,8 +30,9 @@ export default function traceUFOPageLoad(ufoName, routeName = ufoName) {
|
|
|
29
30
|
updatePageLoadInteractionName(ufoName, routeName);
|
|
30
31
|
removeHoldByID(activeInteraction.id, AWAITING_PAGELOAD_NAME);
|
|
31
32
|
}
|
|
32
|
-
}
|
|
33
|
-
export
|
|
33
|
+
});
|
|
34
|
+
export default traceUFOPageLoad;
|
|
35
|
+
export const updatePageloadName = withProfiling(function updatePageloadName(ufoName, routeName = ufoName) {
|
|
34
36
|
const interaction = getActiveInteraction();
|
|
35
37
|
if (!interaction || interaction.type !== 'page_load' && interaction.type !== 'transition') {
|
|
36
38
|
return;
|
|
@@ -45,4 +47,4 @@ export function updatePageloadName(ufoName, routeName = ufoName) {
|
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
removeHoldByID(interaction.id, AWAITING_PAGELOAD_NAME);
|
|
48
|
-
}
|
|
50
|
+
});
|
|
@@ -5,7 +5,8 @@ import { getActiveTrace, setInteractionActiveTrace } from '../experience-trace-i
|
|
|
5
5
|
import { DefaultInteractionID } from '../interaction-id-context';
|
|
6
6
|
import { abortAll, addNewInteraction, getActiveInteraction } from '../interaction-metrics';
|
|
7
7
|
import UFORouteName from '../route-name-context';
|
|
8
|
-
|
|
8
|
+
import { withProfiling } from '../self-measurements';
|
|
9
|
+
const traceUFOPress = withProfiling(function traceUFOPress(name, timestamp) {
|
|
9
10
|
const rate = getInteractionRate(name, 'press');
|
|
10
11
|
const pressInteractionsList = getDoNotAbortActivePressInteraction();
|
|
11
12
|
if (pressInteractionsList !== null && pressInteractionsList !== void 0 && pressInteractionsList.includes(name)) {
|
|
@@ -24,4 +25,5 @@ export default function traceUFOPress(name, timestamp) {
|
|
|
24
25
|
DefaultInteractionID.current = newId;
|
|
25
26
|
addNewInteraction(newId, name, 'press', startTimestamp, rate, [], UFORouteName.current, getActiveTrace());
|
|
26
27
|
}
|
|
27
|
-
}
|
|
28
|
+
});
|
|
29
|
+
export default traceUFOPress;
|