Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(replay): CLS score is not in ms #77397

Merged
merged 2 commits into from
Sep 12, 2024
Merged

fix(replay): CLS score is not in ms #77397

merged 2 commits into from
Sep 12, 2024

Conversation

c298lee
Copy link
Member

@c298lee c298lee commented Sep 12, 2024

If the web vital is CLS, don't include ms. CLS is the only web vital in replays that isn't measured in milliseconds.

Relates to #69881

@c298lee c298lee requested a review from a team as a code owner September 12, 2024 15:20
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 12, 2024
Comment on lines 289 to 292
description: tct('[value][ms] (Good)', {
value: frame.data.value.toFixed(2),
ms: frame.description === 'cumulative-layout-shift' ? '' : 'ms',
}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could perhaps be [unit] and have a function that returns a unit based on the frame description, but realistically only CLS will be non-ms

value: frame.data.value.toFixed(2),
ms: frame.description === 'cumulative-layout-shift' ? '' : 'ms',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit: could move this into a constant to avoid having to type this ternary out 3 times

Copy link

codecov bot commented Sep 12, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
7775 1 7774 0
View the top 1 failed tests by shortest run time
trace view keyboard navigation arrowdown on last node jumps to start trace view keyboard navigation arrowdown on last node jumps to start
Stack Traces | 2.17s run time
Error: Unable to find an element with the text: /transaction-op-0/i. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
...
    at waitForWrapper (.../sentry/sentry/node_modules/@.../dom/dist/wait-for.js:163:27)
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:86:33
    at keyboardNavigationTestSetup (.../performance/newTraceDetails/trace.spec.tsx:273:52)
    at Object.<anonymous> (.../performance/newTraceDetails/trace.spec.tsx:755:17)
    at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:316:40)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:540:9)
    at processTimers (node:internal/timers:514:7)
    at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12)

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@c298lee c298lee merged commit 631e48a into master Sep 12, 2024
41 of 42 checks passed
@c298lee c298lee deleted the cl/web-vital-typo branch September 12, 2024 16:01
mifu67 pushed a commit that referenced this pull request Sep 12, 2024
If the web vital is CLS, don't include `ms`. CLS is the only web vital
in replays that isn't measured in milliseconds.

Relates to #69881
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants