Skip to content

Commit a366135

Browse files
committed
Update TTFA to TTFD, propose new definition for screen loads
1 parent bf828ad commit a366135

File tree

3 files changed

+43
-110
lines changed

3 files changed

+43
-110
lines changed

model/app/events.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,23 @@ groups:
6262
requirement_level: recommended
6363
- ref: app.jank.period
6464
requirement_level: recommended
65+
- id: event.app.screen.visible
66+
stability: development
67+
type: event
68+
name: app.screen.visible
69+
brief: >
70+
This event captures the duration that a screen was visible to the user, indicating the time between when the screen becomes
71+
visible and when it stops being visible.
72+
note: >
73+
This event measures the screen's visibility, in nanoseconds, meaning it includes only the time the screen is actively being shown to the user.
74+
It does not include times when the app is in the background or when other screens/modal views are covering it. For example:
75+
- **iOS**: From `viewDidAppear` to `viewWillDisappear`, indicating when the screen is first shown and when it's about to disappear.
76+
- **Android**: From `onResume` to `onPause`, indicating when the screen comes to the foreground and when it goes to the background.
77+
78+
attributes:
79+
- ref: app.screen.name
80+
requirement_level: required
81+
- ref: app.screen.type
82+
requirement_level: opt_in
83+
- ref: app.screen.visible.duration
84+
requirement_level: required

model/app/registry.yaml

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -86,58 +86,26 @@ groups:
8686
is larger in scope than individual widgets. Multiple screens can
8787
coexist on the same display simultaneously (e.g., split view on tablets).
8888
examples: ["MainActivity", "ProductDetailFragment", "ProfileView", "ProfileViewController"]
89-
- id: app.screen.depth
89+
- id: app.screen.first_draw.duration
9090
type: int
9191
stability: development
9292
brief: >
93-
The depth of this screen in the application’s screen hierarchy, where 0 represents the root screen.
93+
The time, in nanoseconds, from screen initialization to the first frame being rendered.
9494
note: >
95-
Depth represents the screen's position in the screen hierarchy tree.
96-
The root screen of the app is considered to have a depth of 0. Screens
97-
that are nested within other screens (such as in tab navigation, modals,
98-
or multi-screen flows) will have increasing depth values (1, 2, etc.).
99-
For example, a modal screen that is presented over the root screen would
100-
have a depth of 1, while a screen inside a modal might have a depth of 2.
101-
examples: [0, 2, 5]
102-
- id: app.screen.first_appear.duration
103-
type: int
104-
stability: development
105-
brief: >
106-
The time, in nanoseconds, from screen initialization to the first visual render of the screen.
107-
note: >
108-
This measures the time, in nanoseconds, until the first pixels of the screen
109-
are drawn and the screen becomes visible to the user.
110-
It does not necessarily mean the screen is fully interactive or that dynamic content
111-
(like images, API responses, or animations) is fully loaded.
95+
This measures the time, in nanoseconds, until the first frame of the screen
96+
is rendered and becomes visible to the user.
11297
examples: [1000]
11398
- id: app.screen.load.duration
11499
type: int
115100
stability: development
116101
brief: >
117-
The total time, in nanoseconds, from navigation trigger (e.g., button tap)
118-
to when the screen is able to handle user interactions.
102+
The time taken, in nanoseconds, for a screen to load and become stable, measured from when
103+
the screen begins appearing until the first stable frame has been rendered.
119104
note: >
120-
This includes time, in nanoseconds, spent rendering the screen, waiting for dynamic content
121-
(if necessary), and ensuring the app is ready to process user input.
122-
The screen is considered "ready" once the UI is able to respond to user interactions
123-
such as taps, swipes, or gestures.
105+
This attribute represents the total duration, in nanoseconds, of a screen load as experienced by the user.
106+
The screen load is considered complete when the first stable frame of the screen has been rendered.
107+
A frame is considered stable when no major layout or frame changes occur for a brief stability interval (e.g. 150 ms).
124108
examples: [1000]
125-
- id: app.screen.main_thread_busy_time
126-
type: int
127-
stability: development
128-
brief: >
129-
The time, in nanoseconds, during which the main thread is occupied or
130-
blocked from processing user input, such as during rendering, animations,
131-
or network requests. This indicates the time the app is "busy" and unable to respond to user interactions.
132-
- id: app.screen.nodes
133-
type: int
134-
stability: development
135-
brief: >
136-
The total number of visual or interactive elements (widgets, views, components, etc.) within an application screen.
137-
note: >
138-
A "node" is any individual visual or interactive component contained within a screen.
139-
This includes UI elements like buttons, labels, text fields, images, containers, and static content such as images or text.
140-
examples: [5, 23, 147]
141109
- id: app.screen.type
142110
type:
143111
members:
@@ -196,15 +164,7 @@ groups:
196164
stability: development
197165
- id: warm
198166
value: "warm"
199-
brief: App start from background state]
200-
stability: development
201-
- id: hot
202-
value: "hot"
203-
brief: App start from memory (already running)
204-
stability: development
205-
- id: pre_warm
206-
value: "pre_warm"
207-
brief: App start using pre-warmed process
167+
brief: App start from background state
208168
stability: development
209169
stability: development
210170
brief: >
@@ -214,9 +174,7 @@ groups:
214174
215175
- **Cold**: The app is started from a terminated state, meaning no prior instance of the app is running.
216176
- **Warm**: The app is started from the background, meaning an instance of the app is still in memory, but not active.
217-
- **Hot**: The app is already running and brought to the foreground, meaning no re-initialization is needed.
218-
- **Pre-Warm**: The app started uses a pre-warmed process, meaning part of the app's initialization has already been done in anticipation of the start.
219-
examples: ["cold", "warm", "hot", "pre_warm"]
177+
examples: ["cold", "warm"]
220178
- id: app.widget.id
221179
type: string
222180
stability: development

model/app/spans.yaml

Lines changed: 12 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,30 @@
11
groups:
2-
- id: span.app.screen.first_appear.client
2+
- id: span.app.screen.first_draw.client
33
type: span
4-
span_kind: client
5-
brief: This span describes the time until the first visual render of an application UI screen.
4+
span_kind: internal
5+
brief: This span describes the time until the first draw of an application UI screen.
66
note: |
7-
**Span name**: MUST be one of the following based on the measurement:
8-
- `TimeToFirstDraw`: Time from screen initialization to the first pixel drawn.
9-
- `TimeToFirstAppear`: Time from screen initialization to first appearance.
10-
11-
**Span kind** MUST be `CLIENT`.
7+
**Span name**: MUST be `app.screen.first_draw`.
128
13-
This span captures the first visual render of the screen, even if it
14-
might not be fully interactive or loaded yet.
9+
This span captures the time from screen initialization to the first frame drawn.
1510
stability: development
1611
attributes:
1712
- ref: app.screen.name
1813
requirement_level: required
19-
- ref: app.screen.first_appear.duration
14+
- ref: app.screen.first_draw.duration
2015
requirement_level: required
2116
- ref: app.screen.type
2217
requirement_level: opt_in
23-
- ref: app.screen.nodes
24-
requirement_level: opt_in
25-
- ref: app.screen.depth
26-
requirement_level: opt_in
2718
- id: span.app.screen.load.client
2819
type: span
29-
span_kind: client
30-
brief: This span describes an application screen load operation, from navigation trigger to when the main thread becomes ready for user input.
20+
span_kind: internal
21+
brief: This span describes an application screen load operation, from navigation trigger to when the first stable frame has been rendered.
3122
note: |
32-
**Span name:** MUST be `ScreenLoad`.
23+
**Span name:** MUST be `app.screen.load`.
3324
34-
**Span kind** MUST be `CLIENT`.
35-
36-
This span captures the time from user initiation of navigation (e.g., tapping a button) to the point when the main thread is
37-
ready to handle user input (e.g., taps, scrolls, gestures).
38-
**Main thread readiness** refers to when the UI thread is no longer blocked by rendering, animations, or background tasks,
39-
and is free to accept user input.
40-
It is important to note that while the main thread may be ready, some dynamic content, animations, or UI components may
41-
still be loading, making the screen "appear" interactive even if it's not fully ready.
25+
This span captures the time from user initiation of navigation (e.g., tapping a button) to the point when the first stable frame
26+
of the screen has been rendered. A frame is considered stable when no major layout or frame changes occur for a brief stability
27+
interval (e.g. 100–200 ms).
4228
stability: development
4329
attributes:
4430
- ref: app.screen.name
@@ -47,37 +33,6 @@ groups:
4733
requirement_level: opt_in
4834
- ref: app.screen.load.duration
4935
requirement_level: required
50-
- ref: app.screen.nodes
51-
requirement_level: opt_in
52-
- ref: app.screen.depth
53-
requirement_level: opt_in
54-
- ref: app.screen.main_thread_busy_time
55-
requirement_level: opt_in
56-
- id: span.app.screen.visible.client
57-
type: span
58-
span_kind: client
59-
brief: >
60-
This span captures the duration that a screen was visible to the user, indicating the time between when the screen becomes
61-
visible and when it stops being visible.
62-
note: |
63-
**Span name:** MUST be `ScreenVisible`.
64-
65-
**Span kind** MUST be `CLIENT`.
66-
67-
This span captures the amount of time a screen remained visible to the user across platforms. For example:
68-
- **iOS**: From `viewDidAppear` to `viewWillDisappear`, indicating when the screen is first shown and when it's about to disappear.
69-
- **Android**: From `onResume` to `onPause`, indicating when the screen comes to the foreground and when it goes to the background.
70-
71-
This span measures the screen’s visibility, meaning it includes only the time the screen is actively being shown to the user.
72-
It does not include times when the app is in the background or when other screens/modal views are covering it.
73-
stability: development
74-
attributes:
75-
- ref: app.screen.name
76-
requirement_level: required
77-
- ref: app.screen.type
78-
requirement_level: opt_in
79-
- ref: app.screen.visible.duration
80-
requirement_level: required
8136
- id: span.app.start.client
8237
type: span
8338
span_kind: client

0 commit comments

Comments
 (0)