Skip to content

Send UI Profiling app start chunk when it finishes #4423

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stefanosiano
Copy link
Member

📜 Description

init the scopes at profile finish, too, so that it sends the chunk the first time

💡 Motivation and Context

When the startOnAppStart option is used, the first chunk is started when the SDK is not enabled, so it's stored in memory.
The SDK reevaluates the scopes when the next chunk is started, and in the meantime it keeps the chunks in memory until the second chunk finishes.
This is not an issue normally, as it affects only the very first chunk when using the startProfilerOnAppStart option.
But we do it in the UI tests of our demo app, which doesn't send any chunk unless another transaction is started one minute after the app start.

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@stefanosiano stefanosiano marked this pull request as ready for review May 20, 2025 15:15
Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 387.56 ms 397.07 ms 9.51 ms
Size 1.58 MiB 2.08 MiB 510.90 KiB

@@ -162,6 +162,10 @@ private void start() {
rateLimiter.addRateLimitObserver(this);
Copy link
Member

Choose a reason for hiding this comment

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

can this be potentially added multiple times now?

Copy link
Member Author

Choose a reason for hiding this comment

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

it checks for scopes == null, so it should never occur more than once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants