@atlaskit/react-ufo 3.4.14 → 3.5.1
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 +22 -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 +27 -20
- 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 +8 -5
- package/dist/cjs/segment/segment.js +9 -5
- 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 -26
- 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 +170 -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 -8
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +7 -7
- 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 +33 -18
- 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 +7 -4
- package/dist/es2019/segment/segment.js +9 -5
- 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 -25
- 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 +158 -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 -7
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +7 -7
- 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 +27 -20
- 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 +7 -4
- package/dist/esm/segment/segment.js +9 -5
- 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 -25
- 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 +170 -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 -7
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +7 -7
- 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 +12 -12
|
@@ -3,12 +3,13 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
3
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
5
|
import { getConfig as getConfigUFO } from '../../../config';
|
|
6
|
+
import { withProfiling } from '../../../self-measurements';
|
|
6
7
|
var defaultAllowedParams = ['operationName', 'operation', 'q'];
|
|
7
|
-
var getAllowedParams = function getAllowedParams() {
|
|
8
|
+
var getAllowedParams = withProfiling(function getAllowedParams() {
|
|
8
9
|
var config = getConfigUFO();
|
|
9
10
|
return (config === null || config === void 0 ? void 0 : config.allowedResourcesParams) || defaultAllowedParams;
|
|
10
|
-
};
|
|
11
|
-
var handleQueryParams = function handleQueryParams(urlString) {
|
|
11
|
+
});
|
|
12
|
+
var handleQueryParams = withProfiling(function handleQueryParams(urlString) {
|
|
12
13
|
try {
|
|
13
14
|
if (typeof urlString !== 'string') {
|
|
14
15
|
return urlString;
|
|
@@ -35,7 +36,7 @@ var handleQueryParams = function handleQueryParams(urlString) {
|
|
|
35
36
|
} catch (e) {
|
|
36
37
|
return urlString;
|
|
37
38
|
}
|
|
38
|
-
};
|
|
39
|
+
});
|
|
39
40
|
var config = {
|
|
40
41
|
mapResources: function mapResources(url) {
|
|
41
42
|
return url;
|
|
@@ -44,7 +45,7 @@ var config = {
|
|
|
44
45
|
return handleQueryParams(url);
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
|
-
export function configure(resourceTimingConfig) {
|
|
48
|
+
export var configure = withProfiling(function configure(resourceTimingConfig) {
|
|
48
49
|
var newConfig = {
|
|
49
50
|
mapResources: resourceTimingConfig.mapResources,
|
|
50
51
|
sanitiseEndpoints: function sanitiseEndpoints(url) {
|
|
@@ -56,7 +57,7 @@ export function configure(resourceTimingConfig) {
|
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
config = newConfig;
|
|
59
|
-
}
|
|
60
|
-
export var getConfig = function getConfig() {
|
|
60
|
+
});
|
|
61
|
+
export var getConfig = withProfiling(function getConfig() {
|
|
61
62
|
return config;
|
|
62
|
-
};
|
|
63
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { roundEpsilon } from '../../../round-number';
|
|
3
|
+
import { withProfiling } from '../../../self-measurements';
|
|
3
4
|
var getPerformanceObject = function getPerformanceObject() {
|
|
4
5
|
var _window;
|
|
5
6
|
return ((_window = window) !== null && _window !== void 0 ? _window : {}).performance;
|
|
@@ -12,7 +13,7 @@ export var resourceTimingBuffer = {
|
|
|
12
13
|
timings: [],
|
|
13
14
|
maxSize: 1000,
|
|
14
15
|
observer: null,
|
|
15
|
-
transformResource: function transformResource(entry) {
|
|
16
|
+
transformResource: withProfiling(function transformResource(entry) {
|
|
16
17
|
var _entry$serverTiming, _entry$serverTiming2;
|
|
17
18
|
var duration = roundEpsilon(entry.duration);
|
|
18
19
|
|
|
@@ -41,8 +42,8 @@ export var resourceTimingBuffer = {
|
|
|
41
42
|
encodedSize: roundEpsilon(entry.encodedBodySize),
|
|
42
43
|
decodedSize: roundEpsilon(entry.decodedBodySize)
|
|
43
44
|
};
|
|
44
|
-
},
|
|
45
|
-
start: function start() {
|
|
45
|
+
}),
|
|
46
|
+
start: withProfiling(function start() {
|
|
46
47
|
var _performance$getEntri;
|
|
47
48
|
var performance = getPerformanceObject();
|
|
48
49
|
var PerformanceObserver = getPerformanceObserverObject();
|
|
@@ -62,15 +63,15 @@ export var resourceTimingBuffer = {
|
|
|
62
63
|
resourceTimingBuffer.observer.observe({
|
|
63
64
|
entryTypes: ['resource']
|
|
64
65
|
});
|
|
65
|
-
},
|
|
66
|
-
stop: function stop() {
|
|
66
|
+
}),
|
|
67
|
+
stop: withProfiling(function stop() {
|
|
67
68
|
if (resourceTimingBuffer.observer) {
|
|
68
69
|
resourceTimingBuffer.observer.disconnect();
|
|
69
70
|
resourceTimingBuffer.observer = null;
|
|
70
71
|
}
|
|
71
72
|
resourceTimingBuffer.timings = [];
|
|
72
|
-
},
|
|
73
|
-
addTimings: function addTimings(list) {
|
|
73
|
+
}),
|
|
74
|
+
addTimings: withProfiling(function addTimings(list) {
|
|
74
75
|
var _resourceTimingBuffer;
|
|
75
76
|
var entries = list.getEntries().map(function (entry) {
|
|
76
77
|
return resourceTimingBuffer.transformResource(entry);
|
|
@@ -81,12 +82,12 @@ export var resourceTimingBuffer = {
|
|
|
81
82
|
resourceTimingBuffer.timings.splice(0, fieldsToRemove);
|
|
82
83
|
}
|
|
83
84
|
(_resourceTimingBuffer = resourceTimingBuffer.timings).push.apply(_resourceTimingBuffer, _toConsumableArray(entries));
|
|
84
|
-
}
|
|
85
|
+
})
|
|
85
86
|
};
|
|
86
|
-
var isValidTiming = function isValidTiming(timing, startTime, endTime) {
|
|
87
|
+
var isValidTiming = withProfiling(function isValidTiming(timing, startTime, endTime) {
|
|
87
88
|
return timing.startTime >= startTime && timing.startTime + timing.duration <= endTime;
|
|
88
|
-
};
|
|
89
|
-
export var filterResourceTimings = function filterResourceTimings(startTime, endTime) {
|
|
89
|
+
});
|
|
90
|
+
export var filterResourceTimings = withProfiling(function filterResourceTimings(startTime, endTime) {
|
|
90
91
|
var performance = getPerformanceObject();
|
|
91
92
|
var PerformanceObserver = getPerformanceObserverObject();
|
|
92
93
|
if (!PerformanceObserver || !resourceTimingBuffer.observer) {
|
|
@@ -101,4 +102,4 @@ export var filterResourceTimings = function filterResourceTimings(startTime, end
|
|
|
101
102
|
return resourceTimingBuffer.timings.filter(function (timing) {
|
|
102
103
|
return isValidTiming(timing, startTime, endTime);
|
|
103
104
|
});
|
|
104
|
-
};
|
|
105
|
+
});
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
import { getConfig as getConfigUFO } from '../config';
|
|
6
6
|
import { roundEpsilon } from '../round-number';
|
|
7
|
+
import { withProfiling } from '../self-measurements';
|
|
7
8
|
import { getConfig } from './common/utils/config';
|
|
8
9
|
import { filterResourceTimings } from './common/utils/resource-timing-buffer';
|
|
9
10
|
var alwaysCacheableTypes = ['script', 'link'];
|
|
@@ -11,18 +12,20 @@ var resourceTypes = ['fetch', 'xmlhttprequest'];
|
|
|
11
12
|
var CACHE_NETWORK = 'network';
|
|
12
13
|
var CACHE_MEMORY = 'memory';
|
|
13
14
|
var CACHE_DISK = 'disk';
|
|
14
|
-
var isCacheableType = function isCacheableType(url, type) {
|
|
15
|
+
var isCacheableType = withProfiling(function isCacheableType(url, type) {
|
|
15
16
|
if (alwaysCacheableTypes.includes(type)) {
|
|
16
17
|
return true;
|
|
17
18
|
}
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
18
21
|
if (type === 'other' && url.includes('.js') && fg('ufo_support_other_resource_type_js')) {
|
|
19
22
|
return true;
|
|
20
23
|
}
|
|
21
24
|
return false;
|
|
22
|
-
};
|
|
25
|
+
});
|
|
23
26
|
|
|
24
27
|
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
25
|
-
var calculateTransferType = function calculateTransferType(name, type, duration, size) {
|
|
28
|
+
var calculateTransferType = withProfiling(function calculateTransferType(name, type, duration, size) {
|
|
26
29
|
if (!isCacheableType(name, type)) {
|
|
27
30
|
return CACHE_NETWORK;
|
|
28
31
|
}
|
|
@@ -36,16 +39,17 @@ var calculateTransferType = function calculateTransferType(name, type, duration,
|
|
|
36
39
|
return null;
|
|
37
40
|
}
|
|
38
41
|
return CACHE_NETWORK;
|
|
39
|
-
};
|
|
40
|
-
var getWindowObject = function getWindowObject() {
|
|
42
|
+
});
|
|
43
|
+
var getWindowObject = withProfiling(function getWindowObject() {
|
|
41
44
|
return typeof window !== 'undefined' && !!window ? window : undefined;
|
|
42
|
-
};
|
|
43
|
-
var hasAccessToResourceSize = function hasAccessToResourceSize(url, type, entry, hasTimingHeaders) {
|
|
45
|
+
});
|
|
46
|
+
var hasAccessToResourceSize = withProfiling(function hasAccessToResourceSize(url, type, entry, hasTimingHeaders) {
|
|
44
47
|
return !isCacheableType(url, type) || url.includes('localhost') || !!getWindowObject() && url.includes(window.location.hostname) || hasTimingHeaders(url, entry);
|
|
45
|
-
};
|
|
46
|
-
var getReportedInitiatorTypes = function getReportedInitiatorTypes(xhrEnabled) {
|
|
48
|
+
});
|
|
49
|
+
var getReportedInitiatorTypes = withProfiling(function getReportedInitiatorTypes(xhrEnabled) {
|
|
47
50
|
var ufoConfig = getConfigUFO();
|
|
48
51
|
if (!(ufoConfig !== null && ufoConfig !== void 0 && ufoConfig.allowedResources)) {
|
|
52
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
49
53
|
if (fg('ufo_support_other_resource_type_js')) {
|
|
50
54
|
if (xhrEnabled) {
|
|
51
55
|
return ['script', 'link', 'fetch', 'other', 'xmlhttprequest'];
|
|
@@ -59,18 +63,18 @@ var getReportedInitiatorTypes = function getReportedInitiatorTypes(xhrEnabled) {
|
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
return ufoConfig.allowedResources;
|
|
62
|
-
};
|
|
63
|
-
var evaluateAccessToResourceTimings = function evaluateAccessToResourceTimings(url, entry) {
|
|
66
|
+
});
|
|
67
|
+
var evaluateAccessToResourceTimings = withProfiling(function evaluateAccessToResourceTimings(url, entry) {
|
|
64
68
|
return !(entry.responseStart === 0 && entry.startTime > entry.responseStart);
|
|
65
|
-
};
|
|
69
|
+
});
|
|
66
70
|
|
|
67
71
|
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
68
|
-
var getSizeObject = function getSizeObject(size) {
|
|
72
|
+
var getSizeObject = withProfiling(function getSizeObject(size) {
|
|
69
73
|
return size !== undefined ? {
|
|
70
74
|
size: size
|
|
71
75
|
} : null;
|
|
72
|
-
};
|
|
73
|
-
var getNetworkData = function getNetworkData(item, eventStart) {
|
|
76
|
+
});
|
|
77
|
+
var getNetworkData = withProfiling(function getNetworkData(item, eventStart) {
|
|
74
78
|
var hasTimingHeaders = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : evaluateAccessToResourceTimings;
|
|
75
79
|
var name = item.name,
|
|
76
80
|
duration = item.duration,
|
|
@@ -83,6 +87,7 @@ var getNetworkData = function getNetworkData(item, eventStart) {
|
|
|
83
87
|
encodedSize = item.encodedSize,
|
|
84
88
|
decodedSize = item.decodedSize;
|
|
85
89
|
var ttfb = roundEpsilon(responseStart - eventStart);
|
|
90
|
+
var requestStartRelative = roundEpsilon(requestStart - eventStart);
|
|
86
91
|
if (!hasAccessToResourceSize(name, initiatorType, item, hasTimingHeaders)) {
|
|
87
92
|
return {};
|
|
88
93
|
}
|
|
@@ -101,10 +106,10 @@ var getNetworkData = function getNetworkData(item, eventStart) {
|
|
|
101
106
|
ttfb: ttfb,
|
|
102
107
|
serverTime: serverTime,
|
|
103
108
|
networkTime: networkTime,
|
|
104
|
-
requestStart: requestStart
|
|
109
|
+
requestStart: fg('ufo_return_relative_request_start') ? requestStartRelative : requestStart
|
|
105
110
|
}, getSizeObject(transferSize));
|
|
106
|
-
};
|
|
107
|
-
export var getResourceTimings = function getResourceTimings(interactionStart, interactionEnd) {
|
|
111
|
+
});
|
|
112
|
+
export var getResourceTimings = withProfiling(function getResourceTimings(interactionStart, interactionEnd) {
|
|
108
113
|
var resourceTiming = {};
|
|
109
114
|
if (interactionStart === null) {
|
|
110
115
|
return resourceTiming;
|
|
@@ -135,7 +140,9 @@ export var getResourceTimings = function getResourceTimings(interactionStart, in
|
|
|
135
140
|
if (initiatorType === 'xmlhttprequest' && (xhrFilter === undefined || xhrFilter(name) === false)) {
|
|
136
141
|
return;
|
|
137
142
|
}
|
|
138
|
-
if (initiatorType === 'other' && !name.includes('.js') &&
|
|
143
|
+
if (initiatorType === 'other' && !name.includes('.js') &&
|
|
144
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
145
|
+
fg('ufo_support_other_resource_type_js')) {
|
|
139
146
|
return;
|
|
140
147
|
}
|
|
141
148
|
var url = resourceTypes.includes(initiatorType) ? sanitiseEndpoints(name) : mapResources(name);
|
|
@@ -155,4 +162,4 @@ export var getResourceTimings = function getResourceTimings(interactionStart, in
|
|
|
155
162
|
}, getNetworkData(item, interactionStart, hasTimingHeaders));
|
|
156
163
|
});
|
|
157
164
|
return resourceTiming;
|
|
158
|
-
};
|
|
165
|
+
});
|
|
@@ -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 var startResourceTimingBuffer = withProfiling(function startResourceTimingBuffer() {
|
|
3
4
|
resourceTimingBuffer.start();
|
|
4
|
-
}
|
|
5
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
export var roundEpsilon = withProfiling(function roundEpsilon(num) {
|
|
2
3
|
var places = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
3
4
|
var factor = Math.pow(10, places);
|
|
4
5
|
return Math.round((num + Number.EPSILON) * factor) / factor;
|
|
5
|
-
};
|
|
6
|
+
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
var 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,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
var scheduleOnPaint = withProfiling(function scheduleOnPaint(_callback) {
|
|
3
|
+
var _globalThis$document;
|
|
4
|
+
var callback = withProfiling(_callback);
|
|
5
|
+
if (((_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.visibilityState) !== 'visible') {
|
|
4
6
|
// last resort fallback
|
|
5
7
|
setTimeout(callback, 100);
|
|
6
8
|
return;
|
|
@@ -26,4 +28,5 @@ export default function scheduleOnPaint(callback) {
|
|
|
26
28
|
});
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
|
-
}
|
|
31
|
+
});
|
|
32
|
+
export default scheduleOnPaint;
|
|
@@ -13,6 +13,7 @@ import UFOInteractionContext from '../interaction-context';
|
|
|
13
13
|
import UFOInteractionIDContext from '../interaction-id-context';
|
|
14
14
|
import { abortByNewInteraction, addApdex as _addApdex, addCustomData as _addCustomData, addCustomTiming, addHold, addHoldByID, addMark as _addMark, addNewInteraction, addProfilerTimings, addRequestInfo, addSegment, addSpan, removeHoldByID, removeSegment, tryComplete } from '../interaction-metrics';
|
|
15
15
|
import UFORouteName from '../route-name-context';
|
|
16
|
+
import { withProfiling } from '../self-measurements';
|
|
16
17
|
import generateId from '../short-id';
|
|
17
18
|
import scheduleOnPaint from './schedule-on-paint';
|
|
18
19
|
var tryCompleteHandle;
|
|
@@ -25,6 +26,7 @@ var AsyncSegmentHighlight = /*#__PURE__*/lazy(function () {
|
|
|
25
26
|
});
|
|
26
27
|
var noopIdMap = new Map();
|
|
27
28
|
|
|
29
|
+
// KARL TODO: finish self profiling
|
|
28
30
|
/** A portion of the page we apply measurement to */
|
|
29
31
|
export default function UFOSegment(_ref) {
|
|
30
32
|
var _getConfig2;
|
|
@@ -68,11 +70,12 @@ export default function UFOSegment(_ref) {
|
|
|
68
70
|
}, [parentContext, segmentName, segmentId]);
|
|
69
71
|
var interactionId = useContext(UFOInteractionIDContext);
|
|
70
72
|
var interactionContext = useMemo(function () {
|
|
73
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
71
74
|
if (!fg('platform-ufo-add-segment-use-effect')) {
|
|
72
75
|
addSegment(labelStack);
|
|
73
76
|
}
|
|
74
77
|
var lastCompleteEndTime = 0;
|
|
75
|
-
function complete() {
|
|
78
|
+
var complete = withProfiling(function complete() {
|
|
76
79
|
var endTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();
|
|
77
80
|
if (interactionId.current) {
|
|
78
81
|
if (parentContext) {
|
|
@@ -86,10 +89,10 @@ export default function UFOSegment(_ref) {
|
|
|
86
89
|
var _cancelAnimationFrame;
|
|
87
90
|
(_cancelAnimationFrame = cancelAnimationFrame) === null || _cancelAnimationFrame === void 0 || _cancelAnimationFrame(tryCompleteHandle);
|
|
88
91
|
}
|
|
89
|
-
|
|
92
|
+
var onComplete = withProfiling(function onComplete() {
|
|
90
93
|
if (capturedInteractionId === interactionId.current) {
|
|
91
|
-
var
|
|
92
|
-
var isPageVisible = ((
|
|
94
|
+
var _globalThis$document;
|
|
95
|
+
var isPageVisible = (globalThis === null || globalThis === void 0 || (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.visibilityState) === 'visible';
|
|
93
96
|
var canDoRAF = typeof requestAnimationFrame !== 'undefined';
|
|
94
97
|
if (isPageVisible && canDoRAF) {
|
|
95
98
|
tryCompleteHandle = requestAnimationFrame(function () {
|
|
@@ -104,9 +107,10 @@ export default function UFOSegment(_ref) {
|
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
});
|
|
110
|
+
scheduleCallback(NormalPriority, onComplete);
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
|
-
}
|
|
113
|
+
});
|
|
110
114
|
function _internalHold(labelStack, name) {
|
|
111
115
|
var experimental = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
112
116
|
if (interactionId.current != null) {
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
7
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
8
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
globalThis.__ufo_self_measurements = globalThis.__ufo_self_measurements || {
|
|
11
|
+
__internalState: {
|
|
12
|
+
functionStack: []
|
|
13
|
+
},
|
|
14
|
+
runtime: {
|
|
15
|
+
total: 0,
|
|
16
|
+
async: 0,
|
|
17
|
+
error: 0,
|
|
18
|
+
byFunction: {},
|
|
19
|
+
custom: {}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export function resetProfilerMeasurements() {
|
|
23
|
+
globalThis.__ufo_self_measurements = {
|
|
24
|
+
__internalState: {
|
|
25
|
+
functionStack: []
|
|
26
|
+
},
|
|
27
|
+
runtime: {
|
|
28
|
+
total: 0,
|
|
29
|
+
async: 0,
|
|
30
|
+
error: 0,
|
|
31
|
+
byFunction: {},
|
|
32
|
+
custom: {}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function trackFunctionTimingStart(fnName) {
|
|
37
|
+
var _globalThis$__ufo_sel;
|
|
38
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
39
|
+
resetProfilerMeasurements();
|
|
40
|
+
}
|
|
41
|
+
globalThis === null || globalThis === void 0 || (_globalThis$__ufo_sel = globalThis.__ufo_self_measurements) === null || _globalThis$__ufo_sel === void 0 || (_globalThis$__ufo_sel = _globalThis$__ufo_sel.__internalState) === null || _globalThis$__ufo_sel === void 0 || (_globalThis$__ufo_sel = _globalThis$__ufo_sel.functionStack) === null || _globalThis$__ufo_sel === void 0 || _globalThis$__ufo_sel.push(fnName);
|
|
42
|
+
}
|
|
43
|
+
function trackFunctionTimingEnd() {
|
|
44
|
+
var _globalThis$__ufo_sel2;
|
|
45
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
46
|
+
resetProfilerMeasurements();
|
|
47
|
+
}
|
|
48
|
+
globalThis === null || globalThis === void 0 || (_globalThis$__ufo_sel2 = globalThis.__ufo_self_measurements) === null || _globalThis$__ufo_sel2 === void 0 || (_globalThis$__ufo_sel2 = _globalThis$__ufo_sel2.__internalState) === null || _globalThis$__ufo_sel2 === void 0 || (_globalThis$__ufo_sel2 = _globalThis$__ufo_sel2.functionStack) === null || _globalThis$__ufo_sel2 === void 0 || _globalThis$__ufo_sel2.pop();
|
|
49
|
+
}
|
|
50
|
+
function shouldRecordProfilerMeasurement() {
|
|
51
|
+
var _globalThis$__ufo_sel3;
|
|
52
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
53
|
+
resetProfilerMeasurements();
|
|
54
|
+
}
|
|
55
|
+
return (globalThis === null || globalThis === void 0 || (_globalThis$__ufo_sel3 = globalThis.__ufo_self_measurements) === null || _globalThis$__ufo_sel3 === void 0 || (_globalThis$__ufo_sel3 = _globalThis$__ufo_sel3.__internalState) === null || _globalThis$__ufo_sel3 === void 0 || (_globalThis$__ufo_sel3 = _globalThis$__ufo_sel3.functionStack) === null || _globalThis$__ufo_sel3 === void 0 ? void 0 : _globalThis$__ufo_sel3.length) === 0;
|
|
56
|
+
}
|
|
57
|
+
function recordProfilerMeasurement(functionName, duration, isAsync, isError) {
|
|
58
|
+
var tags = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
59
|
+
// discard measurements that are not significant
|
|
60
|
+
if (duration <= 0) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
64
|
+
resetProfilerMeasurements();
|
|
65
|
+
}
|
|
66
|
+
globalThis.__ufo_self_measurements.runtime.total += duration;
|
|
67
|
+
if (isAsync) {
|
|
68
|
+
globalThis.__ufo_self_measurements.runtime.async += duration;
|
|
69
|
+
}
|
|
70
|
+
if (isError) {
|
|
71
|
+
globalThis.__ufo_self_measurements.runtime.error += duration;
|
|
72
|
+
}
|
|
73
|
+
if (functionName in globalThis.__ufo_self_measurements.runtime.byFunction) {
|
|
74
|
+
globalThis.__ufo_self_measurements.runtime.byFunction[functionName] += duration;
|
|
75
|
+
} else {
|
|
76
|
+
globalThis.__ufo_self_measurements.runtime.byFunction[functionName] = duration;
|
|
77
|
+
}
|
|
78
|
+
var _iterator = _createForOfIteratorHelper(tags),
|
|
79
|
+
_step;
|
|
80
|
+
try {
|
|
81
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
82
|
+
var tag = _step.value;
|
|
83
|
+
if (tag in globalThis.__ufo_self_measurements.runtime.custom) {
|
|
84
|
+
globalThis.__ufo_self_measurements.runtime.custom[tag] += duration;
|
|
85
|
+
} else {
|
|
86
|
+
globalThis.__ufo_self_measurements.runtime.custom[tag] = duration;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} catch (err) {
|
|
90
|
+
_iterator.e(err);
|
|
91
|
+
} finally {
|
|
92
|
+
_iterator.f();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function isPromise(value) {
|
|
96
|
+
return value && typeof value.then === 'function';
|
|
97
|
+
}
|
|
98
|
+
export function withProfiling(fn) {
|
|
99
|
+
var tags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
100
|
+
try {
|
|
101
|
+
if (!fg('platform_ufo_self_timings')) {
|
|
102
|
+
return fn; // this is a NOOP wrapper if feature gate is disabled
|
|
103
|
+
}
|
|
104
|
+
} catch (_unused) {
|
|
105
|
+
return fn;
|
|
106
|
+
}
|
|
107
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
108
|
+
return fn;
|
|
109
|
+
}
|
|
110
|
+
if (fn.constructor.name === 'AsyncFunction') {
|
|
111
|
+
return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
112
|
+
var _fn$name;
|
|
113
|
+
var startTime,
|
|
114
|
+
result,
|
|
115
|
+
endTime,
|
|
116
|
+
_endTime,
|
|
117
|
+
_args = arguments;
|
|
118
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
119
|
+
while (1) switch (_context.prev = _context.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
startTime = performance.now();
|
|
122
|
+
trackFunctionTimingStart((_fn$name = fn.name) !== null && _fn$name !== void 0 ? _fn$name : 'anonymous');
|
|
123
|
+
_context.prev = 2;
|
|
124
|
+
_context.next = 5;
|
|
125
|
+
return fn.apply(void 0, _args);
|
|
126
|
+
case 5:
|
|
127
|
+
result = _context.sent;
|
|
128
|
+
endTime = performance.now();
|
|
129
|
+
trackFunctionTimingEnd();
|
|
130
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
131
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, true, false, tags);
|
|
132
|
+
}
|
|
133
|
+
return _context.abrupt("return", result);
|
|
134
|
+
case 12:
|
|
135
|
+
_context.prev = 12;
|
|
136
|
+
_context.t0 = _context["catch"](2);
|
|
137
|
+
_endTime = performance.now();
|
|
138
|
+
trackFunctionTimingEnd();
|
|
139
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
140
|
+
recordProfilerMeasurement(fn.name, _endTime - startTime, true, true, tags);
|
|
141
|
+
}
|
|
142
|
+
throw _context.t0;
|
|
143
|
+
case 18:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context.stop();
|
|
146
|
+
}
|
|
147
|
+
}, _callee, null, [[2, 12]]);
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
return function () {
|
|
151
|
+
var _fn$name2;
|
|
152
|
+
var startTime = performance.now();
|
|
153
|
+
trackFunctionTimingStart((_fn$name2 = fn.name) !== null && _fn$name2 !== void 0 ? _fn$name2 : 'anonymous');
|
|
154
|
+
try {
|
|
155
|
+
var result = fn.apply(void 0, arguments);
|
|
156
|
+
if (isPromise(result)) {
|
|
157
|
+
result.then(function (value) {
|
|
158
|
+
var endTime = performance.now();
|
|
159
|
+
trackFunctionTimingEnd();
|
|
160
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
161
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, true, false, tags);
|
|
162
|
+
}
|
|
163
|
+
return value;
|
|
164
|
+
}).catch(function (value) {
|
|
165
|
+
var endTime = performance.now();
|
|
166
|
+
trackFunctionTimingEnd();
|
|
167
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
168
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, true, true, tags);
|
|
169
|
+
}
|
|
170
|
+
return value;
|
|
171
|
+
});
|
|
172
|
+
} else {
|
|
173
|
+
var endTime = performance.now();
|
|
174
|
+
trackFunctionTimingEnd();
|
|
175
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
176
|
+
recordProfilerMeasurement(fn.name, endTime - startTime, false, false, tags);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
} catch (error) {
|
|
181
|
+
var _endTime2 = performance.now();
|
|
182
|
+
trackFunctionTimingEnd();
|
|
183
|
+
if (shouldRecordProfilerMeasurement()) {
|
|
184
|
+
recordProfilerMeasurement(fn.name, _endTime2 - startTime, false, true, tags);
|
|
185
|
+
}
|
|
186
|
+
throw error;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
export function markProfilingStart(name) {
|
|
191
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
192
|
+
return {
|
|
193
|
+
name: name,
|
|
194
|
+
startTime: -1
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
trackFunctionTimingStart(name);
|
|
198
|
+
return {
|
|
199
|
+
name: name,
|
|
200
|
+
startTime: performance.now()
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
export function markProfilingEnd(_ref2) {
|
|
204
|
+
var name = _ref2.name,
|
|
205
|
+
startTime = _ref2.startTime;
|
|
206
|
+
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
207
|
+
isAsync = _ref3.isAsync,
|
|
208
|
+
isError = _ref3.isError,
|
|
209
|
+
tags = _ref3.tags;
|
|
210
|
+
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
trackFunctionTimingEnd();
|
|
214
|
+
if (!fg('platform_ufo_self_timings')) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
var endTime = performance.now();
|
|
218
|
+
recordProfilerMeasurement(name, endTime - startTime, isAsync, isError, tags);
|
|
219
|
+
}
|
|
220
|
+
export function getProfilerData() {
|
|
221
|
+
return _objectSpread({}, globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime);
|
|
222
|
+
}
|
|
223
|
+
export function getProfilerTotalRuntime() {
|
|
224
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.total) === 'number') {
|
|
225
|
+
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.total);
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
export function getProfilerAsyncRuntime() {
|
|
230
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.async) === 'number') {
|
|
231
|
+
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.async);
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
export function getProfilerRuntimeByFunction(functionName) {
|
|
236
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.byFunction[functionName]) === 'number') {
|
|
237
|
+
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.byFunction[functionName]);
|
|
238
|
+
}
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
export function getProfilerRuntimeByTag(tag) {
|
|
242
|
+
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.custom[tag]) === 'number') {
|
|
243
|
+
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.custom[tag]);
|
|
244
|
+
}
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addError, getActiveInteraction } from '../interaction-metrics';
|
|
2
|
-
|
|
2
|
+
import { withProfiling } from '../self-measurements';
|
|
3
|
+
export var setInteractionError = withProfiling(function setInteractionError(interactionName, error) {
|
|
3
4
|
var 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,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
var generateId = withProfiling(function generateId() {
|
|
2
3
|
var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
|
|
3
4
|
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
4
5
|
var result = '';
|
|
@@ -6,4 +7,5 @@ export default function generateId() {
|
|
|
6
7
|
result += characters.charAt(Math.floor(Math.random() * characters.length));
|
|
7
8
|
}
|
|
8
9
|
return result;
|
|
9
|
-
}
|
|
10
|
+
});
|
|
11
|
+
export default generateId;
|