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

Use a single transactionPerfomanceCollector #2464

Merged
merged 4 commits into from
Jan 12, 2023

Conversation

stefanosiano
Copy link
Member

@stefanosiano stefanosiano commented Jan 10, 2023

📜 Description

the TransactionPerformanceCollector instance is now put in the options, instead of being created in every Hub

💡 Motivation and Context

In the backend we create a Hub for every thread that access a Hub.
We were creating an instance of TransactionPerformanceCollector in the Hub, creating an additional thread (since we use a Timer in the collector) per each hub.
We want to avoid creating too many useless threads, so we are now using a single instance that is saved and retrieved directly from the options

💚 How did you test it?

Unit test

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 338.61 ms 364.76 ms 26.15 ms
Size 1.73 MiB 2.33 MiB 619.30 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
9b794df 354.13 ms 381.26 ms 27.13 ms
4a9c176 336.33 ms 384.73 ms 48.41 ms
5fd37fa 313.08 ms 357.84 ms 44.76 ms
d00c464 337.43 ms 387.57 ms 50.15 ms
81a1a6c 294.04 ms 341.19 ms 47.15 ms
ecf9680 321.55 ms 385.52 ms 63.97 ms
703d523 330.27 ms 377.66 ms 47.39 ms
81a1a6c 328.73 ms 421.28 ms 92.55 ms
507f924 342.51 ms 402.65 ms 60.14 ms
f1150bc 306.15 ms 306.58 ms 0.44 ms

App size

Revision Plain With Sentry Diff
9b794df 1.73 MiB 2.33 MiB 615.83 KiB
4a9c176 1.73 MiB 2.33 MiB 612.69 KiB
5fd37fa 1.73 MiB 2.33 MiB 616.48 KiB
d00c464 1.73 MiB 2.33 MiB 613.02 KiB
81a1a6c 1.73 MiB 2.32 MiB 612.47 KiB
ecf9680 1.73 MiB 2.32 MiB 612.39 KiB
703d523 1.73 MiB 2.33 MiB 613.23 KiB
81a1a6c 1.73 MiB 2.32 MiB 612.47 KiB
507f924 1.73 MiB 2.32 MiB 609.95 KiB
f1150bc 1.73 MiB 2.33 MiB 615.66 KiB

Previous results on branch: fix/single-performance-collector

Startup times

Revision Plain With Sentry Diff
d87e76b 383.88 ms 433.53 ms 49.65 ms
43ba476 291.59 ms 321.92 ms 30.33 ms

App size

Revision Plain With Sentry Diff
d87e76b 1.73 MiB 2.33 MiB 619.30 KiB
43ba476 1.73 MiB 2.33 MiB 617.01 KiB

@stefanosiano stefanosiano marked this pull request as ready for review January 10, 2023 17:01
…od, to allow option customization to be performed before reading it
@codecov-commenter
Copy link

Codecov Report

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

Coverage data is based on head (2d7b796) compared to base (0c7bed9).
Patch coverage: 84.61% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##               main    #2464    +/-   ##
==========================================
  Coverage     80.13%   80.14%            
- Complexity     3834     3872    +38     
==========================================
  Files           310      312     +2     
  Lines         14469    14669   +200     
  Branches       1915     1941    +26     
==========================================
+ Hits          11595    11756   +161     
- Misses         2124     2153    +29     
- Partials        750      760    +10     
Impacted Files Coverage Δ
...ava/io/sentry/TransactionPerformanceCollector.java 91.30% <80.00%> (-1.72%) ⬇️
sentry/src/main/java/io/sentry/Hub.java 78.04% <100.00%> (ø)
sentry/src/main/java/io/sentry/SentryOptions.java 79.63% <100.00%> (+0.09%) ⬆️
sentry/src/main/java/io/sentry/Attachment.java 100.00% <0.00%> (ø)
...java/io/sentry/internal/modules/ModulesLoader.java 92.30% <0.00%> (ø)
...rc/main/java/io/sentry/protocol/ViewHierarchy.java 64.28% <0.00%> (ø)
...ain/java/io/sentry/protocol/ViewHierarchyNode.java 77.88% <0.00%> (ø)
sentry/src/main/java/io/sentry/JsonSerializer.java 98.01% <0.00%> (+0.04%) ⬆️
sentry/src/main/java/io/sentry/SentryClient.java 86.68% <0.00%> (+0.19%) ⬆️
... and 2 more

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.

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

thanks for the fix 👍

@stefanosiano stefanosiano changed the title Use a single transactionPperfomanceCollector Use a single transactionPerfomanceCollector Jan 12, 2023
@stefanosiano stefanosiano merged commit e2e6ab2 into main Jan 12, 2023
@stefanosiano stefanosiano deleted the fix/single-performance-collector branch January 12, 2023 17:52
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.

3 participants