Skip to content

Android: Adds measureActivity test option #23

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 4 commits into from

Conversation

antonis
Copy link

@antonis antonis commented Nov 20, 2024

This PR adds a separate optional test option measureActivity that can be used to specify the activity to be tracked for measuring start up time separately from the startup activity.

This is needed on https://github.com/getsentry/sentry-react-native to correctly measure loading time since the main activity of the application is displayed before RN starts executing and thus before the JS SDK inits.

See getsentry/sentry-react-native#4292 for how this intents to be used.

@antonis antonis marked this pull request as ready for review November 20, 2024 10:30
@antonis antonis marked this pull request as draft November 20, 2024 10:38
@antonis antonis force-pushed the antonis/add-measure-activity branch from 602c033 to 5006173 Compare November 20, 2024 17:34
@@ -220,7 +236,8 @@ class StartupTimeTest : TestBase() {
}

val logEntries = driver.manage().logs().get("logcat")
val regex = Regex("Displayed ${app.name}/\\.${app.activity}: \\+(?:([0-9]+)s)?([0-9]+)ms")
val trackedActivity = app.measureActivity ?: app.activity
val regex = Regex("Displayed ${app.name}/\\.$trackedActivity: \\+(?:([0-9]+)s)?([0-9]+)ms")
Copy link
Author

Choose a reason for hiding this comment

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

Note that the time (ms) grabbed from the measureActivity is probably just the activity launch time and not the app launch time. The later needs to be calculated or grabbed in another way.

@antonis
Copy link
Author

antonis commented Nov 21, 2024

Closing for now since this approach did not work getsentry/sentry-react-native#4292 (comment)

@antonis antonis closed this Nov 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant