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 performance collector setup called in main thread #2499

Merged
merged 5 commits into from
Jan 26, 2023

Conversation

stefanosiano
Copy link
Member

📜 Description

DefaultTransactionPerformanceCollector was calling setup() on main thread, and we moved it to a background thread.

💡 Motivation and Context

Since one of the collectors reads files during setup(), calling it in the main thread would make Android complain if strict mode is applied.

💚 How did you test it?

Unit test

📝 Checklist

  • I reviewed the submitted code
  • 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
  • No breaking changes

🔮 Next steps

# Conflicts:
#	sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java
#	sentry/src/test/java/io/sentry/TransactionPerformanceCollectorTest.kt
@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 302.98 ms 358.35 ms 55.37 ms
Size 1.73 MiB 2.33 MiB 620.49 KiB

@codecov
Copy link

codecov bot commented Jan 26, 2023

Codecov Report

Base: 80.12% // Head: 80.12% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (1649420) compared to base (e199f18).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2499   +/-   ##
=========================================
  Coverage     80.12%   80.12%           
+ Complexity     3920     3919    -1     
=========================================
  Files           322      322           
  Lines         14793    14796    +3     
  Branches       1951     1951           
=========================================
+ Hits          11853    11856    +3     
  Misses         2171     2171           
  Partials        769      769           
Impacted Files Coverage Δ
...sentry/DefaultTransactionPerformanceCollector.java 90.56% <100.00%> (+0.56%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stefanosiano stefanosiano merged commit 46e43bb into main Jan 26, 2023
@stefanosiano stefanosiano deleted the fix/performance-collector-setup-main-thread branch January 26, 2023 17:05
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