@@ -31,7 +31,11 @@ generated by the interaction.
31
31
''' ;
32
32
33
33
/// The maximum amount of time considered safe to spend for a frame's build
34
- /// phase. Anything past that is in the danger of missing the frame as 60FPS.
34
+ /// phase. Anything past that is in the danger of missing the frame at 60FPS.
35
+ ///
36
+ /// This is a hard-coded number and does not take into account the real device
37
+ /// frame rate. Prefer using percentiles on the total build or raster time
38
+ /// than metrics based on this value.
35
39
const Duration kBuildBudget = Duration (milliseconds: 16 );
36
40
37
41
/// The name of the framework frame build events we need to filter or extract.
@@ -71,9 +75,14 @@ class TimelineSummary {
71
75
72
76
/// The number of frames that missed the [kBuildBudget] and therefore are
73
77
/// in the danger of missing frames.
74
- int computeMissedFrameBuildBudgetCount ([ Duration frameBuildBudget = kBuildBudget ]) => _extractFrameDurations ()
75
- .where ((Duration duration) => duration > kBuildBudget)
76
- .length;
78
+ ///
79
+ /// This does not take into account the real device frame rate. Prefer using
80
+ /// [computePercentileFrameBuildTimeMillis] for evaluating performance.
81
+ int computeMissedFrameBuildBudgetCount () {
82
+ return _extractFrameDurations ()
83
+ .where ((Duration duration) => duration > kBuildBudget)
84
+ .length;
85
+ }
77
86
78
87
/// Average amount of time spent per frame in the engine rasterizer.
79
88
///
@@ -112,9 +121,14 @@ class TimelineSummary {
112
121
113
122
/// The number of frames that missed the [kBuildBudget] on the raster thread
114
123
/// and therefore are in the danger of missing frames.
115
- int computeMissedFrameRasterizerBudgetCount ([ Duration frameBuildBudget = kBuildBudget ]) => _extractGpuRasterizerDrawDurations ()
116
- .where ((Duration duration) => duration > kBuildBudget)
117
- .length;
124
+ ///
125
+ /// This does not take into account the real device frame rate. Prefer using
126
+ /// [computePercentileFrameRasterizerTimeMillis] for evaluating performance.
127
+ int computeMissedFrameRasterizerBudgetCount () {
128
+ return _extractGpuRasterizerDrawDurations ()
129
+ .where ((Duration duration) => duration > kBuildBudget)
130
+ .length;
131
+ }
118
132
119
133
/// The total number of frames recorded in the timeline.
120
134
int countFrames () => _extractFrameDurations ().length;
@@ -156,7 +170,8 @@ class TimelineSummary {
156
170
/// See [computeWorstFrameBuildTimeMillis] .
157
171
/// * "missed_frame_build_budget_count': The number of frames that missed
158
172
/// the [kBuildBudget] and therefore are in the danger of missing frames.
159
- /// See [computeMissedFrameBuildBudgetCount] .
173
+ /// See [computeMissedFrameBuildBudgetCount] . Because [kBuildBudget] is a
174
+ /// constant, this does not represent a real missed frame count.
160
175
/// * "average_frame_rasterizer_time_millis": Average amount of time spent
161
176
/// per frame in the engine rasterizer.
162
177
/// See [computeAverageFrameRasterizerTimeMillis] .
@@ -172,8 +187,9 @@ class TimelineSummary {
172
187
/// See [computeWorstFrameRasterizerTimeMillis] .
173
188
/// * "missed_frame_rasterizer_budget_count": The number of frames that missed
174
189
/// the [kBuildBudget] on the raster thread and therefore are in the danger
175
- /// of missing frames.
176
- /// See [computeMissedFrameRasterizerBudgetCount] .
190
+ /// of missing frames. See [computeMissedFrameRasterizerBudgetCount] .
191
+ /// Because [kBuildBudget] is a constant, this does not represent a real
192
+ /// missed frame count.
177
193
/// * "frame_count": The total number of frames recorded in the timeline. This
178
194
/// is also the length of the "frame_build_times" and the "frame_begin_times"
179
195
/// lists.
0 commit comments