@atlaskit/react-ufo 3.6.5 → 3.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +5 -6
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -4
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +6 -6
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -4
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +10 -10
- package/dist/cjs/assets/index.js +14 -17
- package/dist/cjs/assets/utils.js +13 -10
- package/dist/cjs/bundle-eval-timing/index.js +8 -8
- package/dist/cjs/coinflip/index.js +2 -3
- package/dist/cjs/config/index.js +42 -30
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +41 -29
- package/dist/cjs/create-payload/common/utils/index.js +20 -16
- package/dist/cjs/create-payload/index.js +120 -128
- package/dist/cjs/create-payload/utils/get-interaction-status.js +2 -3
- package/dist/cjs/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
- package/dist/cjs/create-payload/utils/get-react-ufo-payload-version.js +3 -4
- package/dist/cjs/create-payload/utils/get-ssr-done-time-value.js +2 -3
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +7 -8
- package/dist/cjs/create-post-interaction-log-payload/index.js +12 -13
- package/dist/cjs/custom-data/index.js +14 -6
- package/dist/cjs/custom-mark/index.js +3 -4
- package/dist/cjs/custom-spans/index.js +3 -4
- package/dist/cjs/custom-timings/index.js +6 -6
- package/dist/cjs/experience-trace-id-context/index.js +21 -16
- package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -4
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +12 -12
- package/dist/cjs/feature-flags-accessed/index.js +4 -4
- package/dist/cjs/generate-id/index.js +2 -3
- package/dist/cjs/global-error-handler/index.js +16 -15
- package/dist/cjs/initial-page-load-extra-timing/index.js +6 -6
- package/dist/cjs/interaction-metrics/index.js +146 -110
- package/dist/cjs/interaction-metrics/post-interaction-log.js +0 -10
- package/dist/cjs/interaction-metrics-init/index.js +15 -16
- package/dist/cjs/interaction-metrics-init/schedule-idle-callback.js +2 -3
- package/dist/cjs/resource-timing/common/utils/config.js +10 -10
- package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +14 -14
- package/dist/cjs/resource-timing/main.js +24 -37
- package/dist/cjs/resource-timing/utils.js +3 -4
- package/dist/cjs/round-number/index.js +3 -4
- package/dist/cjs/route-name/index.js +2 -3
- package/dist/cjs/segment/schedule-on-paint.js +2 -4
- package/dist/cjs/segment/segment.js +4 -5
- package/dist/cjs/set-interaction-error/index.js +3 -4
- package/dist/cjs/short-id/index.js +2 -3
- package/dist/cjs/ssr/index.js +21 -18
- package/dist/cjs/trace-interaction/index.js +4 -5
- package/dist/cjs/trace-pageload/index.js +6 -6
- package/dist/cjs/trace-press/index.js +2 -3
- package/dist/cjs/trace-redirect/index.js +2 -3
- package/dist/cjs/trace-transition/index.js +2 -3
- package/dist/cjs/trace-transition/utils/generate-span-id/index.js +3 -4
- package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +3 -4
- package/dist/cjs/vc/index.js +6 -17
- package/dist/cjs/vc/vc-observer/attachAbortListeners.js +3 -4
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +22 -13
- package/dist/cjs/vc/vc-observer/getViewport.js +6 -6
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +10 -20
- package/dist/cjs/vc/vc-observer/index.js +119 -145
- package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +3 -4
- package/dist/cjs/vc/vc-observer/observers/editor-lnv/index.js +0 -17
- package/dist/cjs/vc/vc-observer/observers/index.js +2 -29
- package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -3
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +0 -2
- package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +0 -2
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +3 -4
- package/dist/cjs/vc/vc-observer-new/entries-timeline/index.js +0 -9
- package/dist/cjs/vc/vc-observer-new/get-element-name.js +2 -3
- package/dist/cjs/vc/vc-observer-new/get-unique-element-name.js +10 -11
- package/dist/cjs/vc/vc-observer-new/index.js +0 -9
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -6
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +12 -20
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +26 -26
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +13 -25
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +7 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +39 -48
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +7 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/task-yield.js +7 -8
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +7 -15
- package/dist/cjs/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +7 -8
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -15
- package/dist/cjs/vc/vc-observer-new/viewport-observer/performance-observer/index.js +9 -9
- package/dist/cjs/vc/vc-observer-new/window-event-observer/index.js +1 -7
- package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +4 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +2 -3
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +4 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +2 -3
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +8 -9
- package/dist/es2019/assets/index.js +14 -19
- package/dist/es2019/assets/utils.js +8 -10
- package/dist/es2019/bundle-eval-timing/index.js +6 -7
- package/dist/es2019/coinflip/index.js +2 -4
- package/dist/es2019/config/index.js +28 -29
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +15 -18
- package/dist/es2019/create-payload/common/utils/index.js +14 -15
- package/dist/es2019/create-payload/index.js +75 -84
- package/dist/es2019/create-payload/utils/get-interaction-status.js +2 -4
- package/dist/es2019/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
- package/dist/es2019/create-payload/utils/get-react-ufo-payload-version.js +2 -3
- package/dist/es2019/create-payload/utils/get-ssr-done-time-value.js +2 -3
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +2 -3
- package/dist/es2019/create-post-interaction-log-payload/index.js +12 -13
- package/dist/es2019/custom-data/index.js +13 -5
- package/dist/es2019/custom-mark/index.js +2 -3
- package/dist/es2019/custom-spans/index.js +2 -3
- package/dist/es2019/custom-timings/index.js +4 -5
- package/dist/es2019/experience-trace-id-context/index.js +14 -15
- package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +2 -3
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +10 -11
- package/dist/es2019/feature-flags-accessed/index.js +2 -3
- package/dist/es2019/generate-id/index.js +2 -3
- package/dist/es2019/global-error-handler/index.js +13 -14
- package/dist/es2019/initial-page-load-extra-timing/index.js +4 -5
- package/dist/es2019/interaction-metrics/index.js +108 -109
- package/dist/es2019/interaction-metrics/post-interaction-log.js +0 -10
- package/dist/es2019/interaction-metrics-init/index.js +14 -15
- package/dist/es2019/interaction-metrics-init/schedule-idle-callback.js +2 -3
- package/dist/es2019/resource-timing/common/utils/config.js +8 -9
- package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +12 -13
- package/dist/es2019/resource-timing/main.js +23 -36
- package/dist/es2019/resource-timing/utils.js +2 -3
- package/dist/es2019/round-number/index.js +2 -3
- package/dist/es2019/route-name/index.js +2 -3
- package/dist/es2019/segment/schedule-on-paint.js +2 -4
- package/dist/es2019/segment/segment.js +4 -5
- package/dist/es2019/set-interaction-error/index.js +2 -3
- package/dist/es2019/short-id/index.js +2 -3
- package/dist/es2019/ssr/index.js +16 -17
- package/dist/es2019/trace-interaction/index.js +4 -5
- package/dist/es2019/trace-pageload/index.js +4 -5
- package/dist/es2019/trace-press/index.js +2 -3
- package/dist/es2019/trace-redirect/index.js +2 -3
- package/dist/es2019/trace-transition/index.js +2 -3
- package/dist/es2019/trace-transition/utils/generate-span-id/index.js +2 -3
- package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +2 -3
- package/dist/es2019/vc/index.js +4 -16
- package/dist/es2019/vc/vc-observer/attachAbortListeners.js +2 -3
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +4 -5
- package/dist/es2019/vc/vc-observer/getViewport.js +4 -5
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +8 -20
- package/dist/es2019/vc/vc-observer/index.js +104 -134
- package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +2 -3
- package/dist/es2019/vc/vc-observer/observers/editor-lnv/index.js +0 -17
- package/dist/es2019/vc/vc-observer/observers/index.js +2 -29
- package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -4
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +0 -2
- package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +0 -2
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +2 -3
- package/dist/es2019/vc/vc-observer-new/entries-timeline/index.js +0 -9
- package/dist/es2019/vc/vc-observer-new/get-element-name.js +2 -3
- package/dist/es2019/vc/vc-observer-new/get-unique-element-name.js +10 -11
- package/dist/es2019/vc/vc-observer-new/index.js +0 -9
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +0 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +4 -14
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +4 -5
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +8 -20
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +8 -9
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/task-yield.js +2 -4
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +7 -15
- package/dist/es2019/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +8 -8
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -15
- package/dist/es2019/vc/vc-observer-new/viewport-observer/performance-observer/index.js +8 -9
- package/dist/es2019/vc/vc-observer-new/window-event-observer/index.js +1 -7
- package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +4 -5
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +2 -3
- package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +4 -5
- package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +2 -3
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +8 -9
- package/dist/esm/assets/index.js +14 -17
- package/dist/esm/assets/utils.js +8 -10
- package/dist/esm/bundle-eval-timing/index.js +6 -7
- package/dist/esm/coinflip/index.js +2 -4
- package/dist/esm/config/index.js +28 -29
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +36 -28
- package/dist/esm/create-payload/common/utils/index.js +14 -15
- package/dist/esm/create-payload/index.js +119 -127
- package/dist/esm/create-payload/utils/get-interaction-status.js +2 -4
- package/dist/esm/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
- package/dist/esm/create-payload/utils/get-react-ufo-payload-version.js +2 -3
- package/dist/esm/create-payload/utils/get-ssr-done-time-value.js +2 -3
- package/dist/esm/create-payload/utils/get-vc-metrics.js +7 -8
- package/dist/esm/create-post-interaction-log-payload/index.js +12 -13
- package/dist/esm/custom-data/index.js +13 -5
- package/dist/esm/custom-mark/index.js +2 -3
- package/dist/esm/custom-spans/index.js +2 -3
- package/dist/esm/custom-timings/index.js +4 -5
- package/dist/esm/experience-trace-id-context/index.js +14 -15
- package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +2 -3
- package/dist/esm/feature-flags-accessed/common/utils/index.js +10 -11
- package/dist/esm/feature-flags-accessed/index.js +2 -3
- package/dist/esm/generate-id/index.js +2 -3
- package/dist/esm/global-error-handler/index.js +13 -14
- package/dist/esm/initial-page-load-extra-timing/index.js +4 -5
- package/dist/esm/interaction-metrics/index.js +108 -109
- package/dist/esm/interaction-metrics/post-interaction-log.js +0 -10
- package/dist/esm/interaction-metrics-init/index.js +14 -15
- package/dist/esm/interaction-metrics-init/schedule-idle-callback.js +2 -3
- package/dist/esm/resource-timing/common/utils/config.js +8 -9
- package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +12 -13
- package/dist/esm/resource-timing/main.js +23 -36
- package/dist/esm/resource-timing/utils.js +2 -3
- package/dist/esm/round-number/index.js +2 -3
- package/dist/esm/route-name/index.js +2 -3
- package/dist/esm/segment/schedule-on-paint.js +2 -4
- package/dist/esm/segment/segment.js +4 -5
- package/dist/esm/set-interaction-error/index.js +2 -3
- package/dist/esm/short-id/index.js +2 -3
- package/dist/esm/ssr/index.js +16 -17
- package/dist/esm/trace-interaction/index.js +4 -5
- package/dist/esm/trace-pageload/index.js +4 -5
- package/dist/esm/trace-press/index.js +2 -3
- package/dist/esm/trace-redirect/index.js +2 -3
- package/dist/esm/trace-transition/index.js +2 -3
- package/dist/esm/trace-transition/utils/generate-span-id/index.js +2 -3
- package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +2 -3
- package/dist/esm/vc/index.js +4 -16
- package/dist/esm/vc/vc-observer/attachAbortListeners.js +2 -3
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +21 -12
- package/dist/esm/vc/vc-observer/getViewport.js +4 -5
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +10 -20
- package/dist/esm/vc/vc-observer/index.js +119 -145
- package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +2 -3
- package/dist/esm/vc/vc-observer/observers/editor-lnv/index.js +0 -17
- package/dist/esm/vc/vc-observer/observers/index.js +2 -29
- package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -4
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +0 -2
- package/dist/esm/vc/vc-observer/revisions/fy25_02.js +0 -2
- package/dist/esm/vc/vc-observer/revisions/revisions.js +2 -3
- package/dist/esm/vc/vc-observer-new/entries-timeline/index.js +0 -9
- package/dist/esm/vc/vc-observer-new/get-element-name.js +2 -3
- package/dist/esm/vc/vc-observer-new/get-unique-element-name.js +10 -11
- package/dist/esm/vc/vc-observer-new/index.js +0 -9
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -6
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +9 -19
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +24 -25
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +13 -25
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +7 -8
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +39 -48
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +7 -8
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/task-yield.js +7 -9
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +7 -15
- package/dist/esm/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +7 -8
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -15
- package/dist/esm/vc/vc-observer-new/viewport-observer/performance-observer/index.js +7 -9
- package/dist/esm/vc/vc-observer-new/window-event-observer/index.js +1 -7
- package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +2 -2
- package/dist/types/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +1 -1
- package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +3 -3
- package/dist/types/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +1 -1
- package/dist/types/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -2
- package/dist/types/assets/index.d.ts +1 -3
- package/dist/types/assets/utils.d.ts +4 -4
- package/dist/types/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types/coinflip/index.d.ts +1 -1
- package/dist/types/common/react-ufo-payload-schema.d.ts +1 -0
- package/dist/types/config/index.d.ts +16 -14
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +4 -5
- package/dist/types/create-payload/common/utils/index.d.ts +8 -7
- package/dist/types/create-payload/index.d.ts +1 -97
- package/dist/types/create-payload/utils/get-interaction-status.d.ts +1 -1
- package/dist/types/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +1 -1
- package/dist/types/create-payload/utils/get-react-ufo-payload-version.d.ts +1 -1
- package/dist/types/create-payload/utils/get-ssr-done-time-value.d.ts +1 -1
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +2 -2
- package/dist/types/create-post-interaction-log-payload/index.d.ts +1 -1
- 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/experience-trace-id-context/index.d.ts +7 -7
- package/dist/types/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +1 -1
- package/dist/types/feature-flags-accessed/common/utils/index.d.ts +2 -2
- package/dist/types/feature-flags-accessed/index.d.ts +1 -1
- package/dist/types/generate-id/index.d.ts +1 -1
- package/dist/types/global-error-handler/index.d.ts +3 -3
- package/dist/types/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types/interaction-context/index.d.ts +1 -1
- package/dist/types/interaction-metrics/index.d.ts +44 -44
- package/dist/types/interaction-metrics/post-interaction-log.d.ts +0 -1
- package/dist/types/interaction-metrics-init/index.d.ts +1 -1
- package/dist/types/interaction-metrics-init/schedule-idle-callback.d.ts +1 -1
- package/dist/types/resource-timing/common/utils/config.d.ts +2 -2
- package/dist/types/resource-timing/common/utils/resource-timing-buffer.d.ts +5 -5
- package/dist/types/resource-timing/main.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 +3 -3
- package/dist/types/segment/schedule-on-paint.d.ts +1 -1
- package/dist/types/set-interaction-error/index.d.ts +1 -1
- package/dist/types/short-id/index.d.ts +1 -1
- package/dist/types/ssr/index.d.ts +5 -5
- package/dist/types/trace-interaction/index.d.ts +1 -1
- package/dist/types/trace-pageload/index.d.ts +2 -2
- package/dist/types/trace-press/index.d.ts +1 -1
- package/dist/types/trace-redirect/index.d.ts +1 -1
- package/dist/types/trace-transition/index.d.ts +1 -1
- package/dist/types/trace-transition/utils/generate-span-id/index.d.ts +1 -1
- package/dist/types/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -1
- package/dist/types/vc/index.d.ts +2 -2
- package/dist/types/vc/vc-observer/attachAbortListeners.d.ts +2 -2
- package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +5 -5
- package/dist/types/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +1 -1
- package/dist/types/vc/vc-observer/index.d.ts +4 -4
- package/dist/types/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -1
- package/dist/types/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +4 -4
- package/dist/types/vc/vc-observer/revisions/revisions.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/get-element-name.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/get-unique-element-name.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +2 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +2 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +2 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/intersection-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +2 -2
- package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +2 -2
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +1 -1
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +3 -3
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +1 -1
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -2
- package/dist/types-ts4.5/assets/index.d.ts +1 -3
- package/dist/types-ts4.5/assets/utils.d.ts +4 -4
- package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/coinflip/index.d.ts +1 -1
- package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +1 -0
- package/dist/types-ts4.5/config/index.d.ts +20 -14
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +4 -5
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +8 -7
- package/dist/types-ts4.5/create-payload/index.d.ts +1 -97
- package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-react-ufo-payload-version.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-ssr-done-time-value.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +2 -2
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +1 -1
- 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/experience-trace-id-context/index.d.ts +7 -7
- package/dist/types-ts4.5/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +1 -1
- package/dist/types-ts4.5/feature-flags-accessed/common/utils/index.d.ts +2 -2
- package/dist/types-ts4.5/feature-flags-accessed/index.d.ts +1 -1
- package/dist/types-ts4.5/generate-id/index.d.ts +1 -1
- package/dist/types-ts4.5/global-error-handler/index.d.ts +3 -3
- 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 +1 -1
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +44 -44
- package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +0 -1
- package/dist/types-ts4.5/interaction-metrics-init/index.d.ts +1 -1
- package/dist/types-ts4.5/interaction-metrics-init/schedule-idle-callback.d.ts +1 -1
- package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +2 -2
- package/dist/types-ts4.5/resource-timing/common/utils/resource-timing-buffer.d.ts +5 -5
- package/dist/types-ts4.5/resource-timing/main.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 +3 -3
- package/dist/types-ts4.5/segment/schedule-on-paint.d.ts +1 -1
- package/dist/types-ts4.5/set-interaction-error/index.d.ts +1 -1
- package/dist/types-ts4.5/short-id/index.d.ts +1 -1
- package/dist/types-ts4.5/ssr/index.d.ts +5 -5
- package/dist/types-ts4.5/trace-interaction/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-pageload/index.d.ts +2 -2
- package/dist/types-ts4.5/trace-press/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-redirect/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-transition/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-transition/utils/generate-span-id/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/attachAbortListeners.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +5 -5
- 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 +1 -1
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +4 -4
- package/dist/types-ts4.5/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +4 -4
- package/dist/types-ts4.5/vc/vc-observer/revisions/revisions.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-element-name.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-unique-element-name.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +1 -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/intersection-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +2 -2
- package/package.json +4 -4
- package/dist/cjs/self-measurements/index.js +0 -261
- package/dist/es2019/self-measurements/index.js +0 -213
- package/dist/esm/self-measurements/index.js +0 -246
- package/dist/types/self-measurements/index.d.ts +0 -57
- package/dist/types-ts4.5/self-measurements/index.d.ts +0 -57
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getProfilerAsyncRuntime = getProfilerAsyncRuntime;
|
|
8
|
-
exports.getProfilerData = getProfilerData;
|
|
9
|
-
exports.getProfilerRuntimeByFunction = getProfilerRuntimeByFunction;
|
|
10
|
-
exports.getProfilerRuntimeByTag = getProfilerRuntimeByTag;
|
|
11
|
-
exports.getProfilerTotalRuntime = getProfilerTotalRuntime;
|
|
12
|
-
exports.markProfilingEnd = markProfilingEnd;
|
|
13
|
-
exports.markProfilingStart = markProfilingStart;
|
|
14
|
-
exports.resetProfilerMeasurements = resetProfilerMeasurements;
|
|
15
|
-
exports.withProfiling = withProfiling;
|
|
16
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
|
-
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; }
|
|
21
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
-
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; } } }; }
|
|
23
|
-
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; } }
|
|
24
|
-
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; }
|
|
25
|
-
globalThis.__ufo_self_measurements = globalThis.__ufo_self_measurements || {
|
|
26
|
-
__internalState: {
|
|
27
|
-
functionStack: []
|
|
28
|
-
},
|
|
29
|
-
runtime: {
|
|
30
|
-
total: 0,
|
|
31
|
-
async: 0,
|
|
32
|
-
error: 0,
|
|
33
|
-
byFunction: {},
|
|
34
|
-
custom: {}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
function resetProfilerMeasurements() {
|
|
38
|
-
globalThis.__ufo_self_measurements = {
|
|
39
|
-
__internalState: {
|
|
40
|
-
functionStack: []
|
|
41
|
-
},
|
|
42
|
-
runtime: {
|
|
43
|
-
total: 0,
|
|
44
|
-
async: 0,
|
|
45
|
-
error: 0,
|
|
46
|
-
byFunction: {},
|
|
47
|
-
custom: {}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function trackFunctionTimingStart(fnName) {
|
|
52
|
-
var _globalThis$__ufo_sel;
|
|
53
|
-
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
54
|
-
resetProfilerMeasurements();
|
|
55
|
-
}
|
|
56
|
-
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);
|
|
57
|
-
}
|
|
58
|
-
function trackFunctionTimingEnd() {
|
|
59
|
-
var _globalThis$__ufo_sel2;
|
|
60
|
-
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
61
|
-
resetProfilerMeasurements();
|
|
62
|
-
}
|
|
63
|
-
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();
|
|
64
|
-
}
|
|
65
|
-
function shouldRecordProfilerMeasurement() {
|
|
66
|
-
var _globalThis$__ufo_sel3;
|
|
67
|
-
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
68
|
-
resetProfilerMeasurements();
|
|
69
|
-
}
|
|
70
|
-
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;
|
|
71
|
-
}
|
|
72
|
-
function recordProfilerMeasurement(functionName, duration, isAsync, isError) {
|
|
73
|
-
var tags = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
74
|
-
// discard measurements that are not significant
|
|
75
|
-
if (duration <= 0) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (!(globalThis !== null && globalThis !== void 0 && globalThis.__ufo_self_measurements)) {
|
|
79
|
-
resetProfilerMeasurements();
|
|
80
|
-
}
|
|
81
|
-
globalThis.__ufo_self_measurements.runtime.total += duration;
|
|
82
|
-
if (isAsync) {
|
|
83
|
-
globalThis.__ufo_self_measurements.runtime.async += duration;
|
|
84
|
-
}
|
|
85
|
-
if (isError) {
|
|
86
|
-
globalThis.__ufo_self_measurements.runtime.error += duration;
|
|
87
|
-
}
|
|
88
|
-
if (functionName in globalThis.__ufo_self_measurements.runtime.byFunction) {
|
|
89
|
-
globalThis.__ufo_self_measurements.runtime.byFunction[functionName] += duration;
|
|
90
|
-
} else {
|
|
91
|
-
globalThis.__ufo_self_measurements.runtime.byFunction[functionName] = duration;
|
|
92
|
-
}
|
|
93
|
-
var _iterator = _createForOfIteratorHelper(tags),
|
|
94
|
-
_step;
|
|
95
|
-
try {
|
|
96
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
97
|
-
var tag = _step.value;
|
|
98
|
-
if (tag in globalThis.__ufo_self_measurements.runtime.custom) {
|
|
99
|
-
globalThis.__ufo_self_measurements.runtime.custom[tag] += duration;
|
|
100
|
-
} else {
|
|
101
|
-
globalThis.__ufo_self_measurements.runtime.custom[tag] = duration;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
} catch (err) {
|
|
105
|
-
_iterator.e(err);
|
|
106
|
-
} finally {
|
|
107
|
-
_iterator.f();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function isPromise(value) {
|
|
111
|
-
return value && typeof value.then === 'function';
|
|
112
|
-
}
|
|
113
|
-
function withProfiling(fn) {
|
|
114
|
-
var tags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
115
|
-
try {
|
|
116
|
-
if (!(0, _platformFeatureFlags.fg)('platform_ufo_self_timings')) {
|
|
117
|
-
return fn; // this is a NOOP wrapper if feature gate is disabled
|
|
118
|
-
}
|
|
119
|
-
} catch (_unused) {
|
|
120
|
-
return fn;
|
|
121
|
-
}
|
|
122
|
-
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
123
|
-
return fn;
|
|
124
|
-
}
|
|
125
|
-
if (fn.constructor.name === 'AsyncFunction') {
|
|
126
|
-
return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
127
|
-
var _fn$name;
|
|
128
|
-
var startTime,
|
|
129
|
-
result,
|
|
130
|
-
endTime,
|
|
131
|
-
_endTime,
|
|
132
|
-
_args = arguments;
|
|
133
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
134
|
-
while (1) switch (_context.prev = _context.next) {
|
|
135
|
-
case 0:
|
|
136
|
-
startTime = performance.now();
|
|
137
|
-
trackFunctionTimingStart((_fn$name = fn.name) !== null && _fn$name !== void 0 ? _fn$name : 'anonymous');
|
|
138
|
-
_context.prev = 2;
|
|
139
|
-
_context.next = 5;
|
|
140
|
-
return fn.apply(void 0, _args);
|
|
141
|
-
case 5:
|
|
142
|
-
result = _context.sent;
|
|
143
|
-
endTime = performance.now();
|
|
144
|
-
trackFunctionTimingEnd();
|
|
145
|
-
if (shouldRecordProfilerMeasurement()) {
|
|
146
|
-
recordProfilerMeasurement(fn.name, endTime - startTime, true, false, tags);
|
|
147
|
-
}
|
|
148
|
-
return _context.abrupt("return", result);
|
|
149
|
-
case 12:
|
|
150
|
-
_context.prev = 12;
|
|
151
|
-
_context.t0 = _context["catch"](2);
|
|
152
|
-
_endTime = performance.now();
|
|
153
|
-
trackFunctionTimingEnd();
|
|
154
|
-
if (shouldRecordProfilerMeasurement()) {
|
|
155
|
-
recordProfilerMeasurement(fn.name, _endTime - startTime, true, true, tags);
|
|
156
|
-
}
|
|
157
|
-
throw _context.t0;
|
|
158
|
-
case 18:
|
|
159
|
-
case "end":
|
|
160
|
-
return _context.stop();
|
|
161
|
-
}
|
|
162
|
-
}, _callee, null, [[2, 12]]);
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
return function () {
|
|
166
|
-
var _fn$name2;
|
|
167
|
-
var startTime = performance.now();
|
|
168
|
-
trackFunctionTimingStart((_fn$name2 = fn.name) !== null && _fn$name2 !== void 0 ? _fn$name2 : 'anonymous');
|
|
169
|
-
try {
|
|
170
|
-
var result = fn.apply(void 0, arguments);
|
|
171
|
-
if (isPromise(result)) {
|
|
172
|
-
result.then(function (value) {
|
|
173
|
-
var endTime = performance.now();
|
|
174
|
-
trackFunctionTimingEnd();
|
|
175
|
-
if (shouldRecordProfilerMeasurement()) {
|
|
176
|
-
recordProfilerMeasurement(fn.name, endTime - startTime, true, false, tags);
|
|
177
|
-
}
|
|
178
|
-
return value;
|
|
179
|
-
}).catch(function (value) {
|
|
180
|
-
var endTime = performance.now();
|
|
181
|
-
trackFunctionTimingEnd();
|
|
182
|
-
if (shouldRecordProfilerMeasurement()) {
|
|
183
|
-
recordProfilerMeasurement(fn.name, endTime - startTime, true, true, tags);
|
|
184
|
-
}
|
|
185
|
-
return value;
|
|
186
|
-
});
|
|
187
|
-
} else {
|
|
188
|
-
var endTime = performance.now();
|
|
189
|
-
trackFunctionTimingEnd();
|
|
190
|
-
if (shouldRecordProfilerMeasurement()) {
|
|
191
|
-
recordProfilerMeasurement(fn.name, endTime - startTime, false, false, tags);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return result;
|
|
195
|
-
} catch (error) {
|
|
196
|
-
var _endTime2 = performance.now();
|
|
197
|
-
trackFunctionTimingEnd();
|
|
198
|
-
if (shouldRecordProfilerMeasurement()) {
|
|
199
|
-
recordProfilerMeasurement(fn.name, _endTime2 - startTime, false, true, tags);
|
|
200
|
-
}
|
|
201
|
-
throw error;
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
function markProfilingStart(name) {
|
|
206
|
-
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
207
|
-
return {
|
|
208
|
-
name: name,
|
|
209
|
-
startTime: -1
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
trackFunctionTimingStart(name);
|
|
213
|
-
return {
|
|
214
|
-
name: name,
|
|
215
|
-
startTime: performance.now()
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
function markProfilingEnd(_ref2) {
|
|
219
|
-
var name = _ref2.name,
|
|
220
|
-
startTime = _ref2.startTime;
|
|
221
|
-
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
222
|
-
isAsync = _ref3.isAsync,
|
|
223
|
-
isError = _ref3.isError,
|
|
224
|
-
tags = _ref3.tags;
|
|
225
|
-
if (!(globalThis !== null && globalThis !== void 0 && globalThis.performance)) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
trackFunctionTimingEnd();
|
|
229
|
-
if (!(0, _platformFeatureFlags.fg)('platform_ufo_self_timings')) {
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
var endTime = performance.now();
|
|
233
|
-
recordProfilerMeasurement(name, endTime - startTime, isAsync, isError, tags);
|
|
234
|
-
}
|
|
235
|
-
function getProfilerData() {
|
|
236
|
-
return _objectSpread({}, globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime);
|
|
237
|
-
}
|
|
238
|
-
function getProfilerTotalRuntime() {
|
|
239
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.total) === 'number') {
|
|
240
|
-
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.total);
|
|
241
|
-
}
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
function getProfilerAsyncRuntime() {
|
|
245
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.async) === 'number') {
|
|
246
|
-
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.async);
|
|
247
|
-
}
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
|
-
function getProfilerRuntimeByFunction(functionName) {
|
|
251
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.byFunction[functionName]) === 'number') {
|
|
252
|
-
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.byFunction[functionName]);
|
|
253
|
-
}
|
|
254
|
-
return null;
|
|
255
|
-
}
|
|
256
|
-
function getProfilerRuntimeByTag(tag) {
|
|
257
|
-
if (typeof (globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.custom[tag]) === 'number') {
|
|
258
|
-
return Math.round(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__ufo_self_measurements.runtime.custom[tag]);
|
|
259
|
-
}
|
|
260
|
-
return null;
|
|
261
|
-
}
|
|
@@ -1,213 +0,0 @@
|
|
|
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
|
-
}
|