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

feat(functions): Use flamegraph as data source for slowest functions #80791

Merged

Conversation

Zylphrex
Copy link
Member

This switches the slowest functions table within transaction summary to use flamegraphs as a data source instead of the functions table. This is because with continuous profiling, the functions table does not have any transaction information for continuous profiles. So to be compatible with both profiling modes, we need to switch to using flamegraphs.

This switches the slowest functions table within transaction summary to use
flamegraphs as a data source instead of the functions table. This is because
with continuous profiling, the functions table does not have any transaction
information for continuous profiles. So to be compatible with both profiling
modes, we need to switch to using flamegraphs.
@Zylphrex Zylphrex requested review from a team as code owners November 14, 2024 22:15
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 14, 2024
Copy link

codecov bot commented Nov 14, 2024

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
8211 3 8208 0
View the top 3 failed tests by shortest run time
Performance > TransactionSummary with events renders pagination buttons
Stack Traces | 0.884s run time
TestingLibraryElementError: Found multiple elements with the text of: Next

Here are the matching elements:

Ignored nodes: comments, script, style
...

Ignored nodes: comments, script, style
...

(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).

Ignored nodes: comments, script, style
...
    at Object.getElementError (.../sentry/sentry/node_modules/@.../dom/dist/config.js:37:19)
    at getElementError (.../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:20:35)
    at getMultipleElementsFoundError (.../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:23:10)
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:55:13
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:95:19
    at Object.<anonymous> (.../transactionSummary/transactionOverview/index.spec.tsx:816:78)
Transaction Summary Content performs basic rendering
Stack Traces | 1.02s run time
Error: Expected test not to call console.error().

If the error is expected, test for it explicitly by mocking it out using jest.spyOn(console, 'error').mockImplementation() and test that the warning occurs.



Error: No mocked response found for request: GET .../org-slug/profiling/flamegraph/
    at Object.<anonymous> (.../transactionSummary/transactionOverview/content.spec.tsx:169:37)
    at Promise.then.completed (.../jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (.../jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9)
    at run (.../jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../jest-runner/build/runTest.js:367:16)
    at runTest (.../jest-runner/build/runTest.js:444:34)
    at Object.worker (.../jest-runner/build/testWorker.js:106:12)
    at console.captureMessage [as error] (.../node_modules/jest-fail-on-console/index.js:83:25)
    at Object.<anonymous> (.../app/__mocks__/api.tsx:47:15)
    at Promise.then.completed (.../jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10)
    at _callCircusHook (.../jest-circus/build/run.js:281:40)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at processTimers (node:internal/timers:511:9)
    at _runTest (.../jest-circus/build/run.js:254:5)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9)
    at run (.../jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../jest-runner/build/runTest.js:367:16)
    at runTest (.../jest-runner/build/runTest.js:444:34)
    at Object.worker (.../jest-runner/build/testWorker.js:106:12)
    at flushUnexpectedConsoleCalls (.../node_modules/jest-fail-on-console/index.js:48:13)
    at Object.<anonymous> (.../node_modules/jest-fail-on-console/index.js:139:7)
    at Promise.then.completed (.../jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/utils.js:231:10)
    at _callCircusHook (.../jest-circus/build/run.js:281:40)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at processTimers (node:internal/timers:511:9)
    at _runTest (.../jest-circus/build/run.js:254:5)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../jest-circus/build/run.js:121:9)
    at run (.../jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../jest-runner/build/runTest.js:367:16)
    at runTest (.../jest-runner/build/runTest.js:444:34)
    at Object.worker (.../jest-runner/build/testWorker.js:106:12)
Performance > TransactionSummary with events triggers a navigation on transaction filter
Stack Traces | 1.6s run time
Error: expect(element).not.toBeInTheDocument()

expected document not to contain element, found <div class="loading" data-test-id="loading-indicator"><div class="loading-indicator" /><div class="loading-message" /></div> instead

Ignored nodes: comments, script, style
...
    at .../transactionSummary/transactionOverview/index.spec.tsx:779:84
    at runWithExpensiveErrorDiagnosticsDisabled (.../sentry/sentry/node_modules/@.../dom/dist/config.js:47:12)
    at checkCallback (.../sentry/sentry/node_modules/@.../dom/dist/wait-for.js:124:77)
    at checkRealTimersCallback (.../sentry/sentry/node_modules/@.../dom/dist/wait-for.js:118:16)
    at Timeout.task [as _onTimeout] (.../sentry/sentry/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7)

To view more test analytics, go to the Test Analytics Dashboard
Got feedback? Let us know on Github

@Zylphrex Zylphrex merged commit 7a3168c into master Nov 15, 2024
42 of 43 checks passed
@Zylphrex Zylphrex deleted the txiao/feat/use-flamegraph-as-data-source-for-slowest-functions branch November 15, 2024 15:25
Copy link

sentry-io bot commented Nov 21, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TestingLibraryElementError: Unable to find an element with the text: /performance. This could be because the text is broken u... Object.?(index.spec.tsx) View Issue

Did you find this useful? React with a 👍 or 👎

@viglia
Copy link
Contributor

viglia commented Nov 21, 2024

@Zylphrex just a clarification: this is to use the live-aggregated metrics attached to the flamegraph, correct?

@Zylphrex
Copy link
Member Author

@Zylphrex just a clarification: this is to use the live-aggregated metrics attached to the flamegraph, correct?

Yes, that is correct.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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