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(performance): make ActivityFramesTracker public #1922
Conversation
If the Context used in SentryAndroid.init is not an Application then the ActivityFramesTracker integration is not automatically added to the available ones. It might be possible that applications need to init Sentry in Context#attachBaseContext providing base Context instead of the current Application. With this change, integrators can enable ActivityFramesTracker integration during configuration init.
Codecov Report
@@ Coverage Diff @@
## main #1922 +/- ##
=========================================
Coverage 75.46% 75.46%
Complexity 2248 2248
=========================================
Files 225 225
Lines 8036 8036
Branches 851 851
=========================================
Hits 6064 6064
Misses 1562 1562
Partials 410 410 Continue to review full report at Codecov.
|
flavorDimensions += "init" | ||
productFlavors { | ||
create("default") { | ||
dimension = "init" | ||
applicationIdSuffix = ".default" | ||
versionNameSuffix = "-default" | ||
} | ||
create("early") { | ||
dimension = "init" | ||
applicationIdSuffix = ".early" | ||
versionNameSuffix = "-early" | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flavorDimensions += "init" | |
productFlavors { | |
create("default") { | |
dimension = "init" | |
applicationIdSuffix = ".default" | |
versionNameSuffix = "-default" | |
} | |
create("early") { | |
dimension = "init" | |
applicationIdSuffix = ".early" | |
versionNameSuffix = "-early" | |
} | |
} | |
flavorDimensions += "init" | |
productFlavors { | |
create("default") { | |
dimension = "init" | |
applicationIdSuffix = ".default" | |
versionNameSuffix = "-default" | |
} | |
create("early") { | |
dimension = "init" | |
applicationIdSuffix = ".early" | |
versionNameSuffix = "-early" | |
} | |
} | |
I'd rather remove the flavors since it makes the build slower, with more stuff to build and test, per flavor.
@@ -0,0 +1,53 @@ | |||
package io.sentry.samples.android; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather roll back the sample changes, and focus only on the classes visibility.
@ninniuz please add an entry to the changelog :) Thanks for doing this. |
📜 Description
Make
ActivityFramesTracker
andLoadClass
public.💡 Motivation and Context
If the
Context
used inSentryAndroid.init
is not anApplication
then theActivityFramesTracker
integration is not automatically added to the available ones.It might be possible that applications need to init Sentry in
Context#attachBaseContext
providing baseContext
instead of the currentApplication
.With this change, integrators can enable
ActivityFramesTracker
integration during configuration init.💚 How did you test it?
I have created two variants of the sample Android app and verified them both against a personal sentry.io project.
📝 Checklist
🔮 Next steps
Maybe add a no-args ctor to
ActivityFramesTracker
which internally provisions an instance ofLoadClass
? It feels a bit awkward to have to create that class in the ctor.