Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Comments

Add reporting when the app is fully drawn to the framework#351

Merged
tiembo merged 8 commits intogoogle:masterfrom
benbaxter:github-fully-drawn
Jun 25, 2020
Merged

Add reporting when the app is fully drawn to the framework#351
tiembo merged 8 commits intogoogle:masterfrom
benbaxter:github-fully-drawn

Conversation

@benbaxter
Copy link
Member

Invoking Activity#reportFullyDrawn() once the data has been loaded and the screen has been rendered to the user.

The entry points into the app are the OnboardingActivity, MainActivity, and SessionDetailsActvitiy. Each of these report when they have been fully drawn independently to the framework. The Android framework prints a log statement as follows:

I/ActivityTaskManager: Fully drawn com.google.samples.apps.iosched/.ui.MainActivity: +3s493ms

This is used for measuring startup time and is a helpful signal when diagnosing startup performance issues. Check out the vitals documentation for more about the usage of reportFullyDrawn().

The Feed is the main view that launches when the app opens (after onboarding). Once the feed items are fetched, we post reporting fully drawn until after the recycler view finishes drawing the items.

Activity#reportFullyDrawn() prints a log statement that looks like this:
I/ActivityTaskManager: Fully drawn com.google.samples.apps.iosched/.ui.MainActivity: +3s493ms

Reporting fulling drawn from onboarding and deeplinking into SessionDetails will be in follow up CLs.

Bug: 158839978
Test: Manually check for the log statement from the framework
Change-Id: I5d4f6f2f93aaa7f0edcc12442d6b30d87dc76107
When a user opens a deeplink into the session details, we should report when the screen has been fully drawn.

Activity#reportFullyDrawn() prints a log statement that looks like this:
I/ActivityTaskManager: Fully drawn com.google.samples.apps.iosched/.ui.sessiondetail.SessionDetailActivity: +516ms

Change-Id: Ib2b8ad08a6a7b8a7459e9412f2ebb180991a3f0c
Depending on the time, we have several entrance onboarding screens presented to the user. The content in hardcoded so we can report fully drawn as soon as the views are rendered.

Activity#reportFullyDrawn() prints a log statement that looks like this:
I/ActivityTaskManager: Fully drawn com.google.samples.apps.iosched/.ui.onboarding.OnboardingActivity: +3s87ms

Change-Id: I1295ae041560da539475630726bb0ce71aa470b4
Change-Id: I2d53bba09839548df4eabcdcae060d8398b98327
Change-Id: I2955ae253ac49c2d8478263ea05ebc8e3c98f648
Copy link
Collaborator

@jdkoren jdkoren left a comment

Choose a reason for hiding this comment

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

Part of me wonders if we need to go through ViewModels to report this since it's specific to the UI/platform and doesn't really impact any business logic. Would it be enough to just rely on doOnLayout in our activities?

Change-Id: Ifb619989923890c6d453f416659c81fabe10105d
Change-Id: I36b4252fa779a2479d8d9106d3a6ea28888e0ef9
@benbaxter
Copy link
Member Author

Part of me wonders if we need to go through ViewModels to report this since it's specific to the UI/platform and doesn't really impact any business logic. Would it be enough to just rely on doOnLayout in our activities?

Good point! I removed the view model middle layer. Originally I thought multiple views would report when they had finished drawing but since doOnLayout also handles when the subviews have completed layout, the complexity was greatly reduced.

@benbaxter benbaxter closed this Jun 19, 2020
@benbaxter benbaxter reopened this Jun 19, 2020
Change-Id: Id7402173643b953526d2c69923330df49100cae2
@tiembo tiembo merged commit b428d2b into google:master Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants