@@ -54,11 +54,21 @@ TaskFunction createCubicBezierPerfTest() {
5454 ).run;
5555}
5656
57- TaskFunction createBackdropFilterPerfTest () {
57+ TaskFunction createBackdropFilterPerfTest ({ bool needsMeasureCpuGpu = false } ) {
5858 return PerfTest (
5959 '${flutterDirectory .path }/dev/benchmarks/macrobenchmarks' ,
6060 'test_driver/backdrop_filter_perf.dart' ,
6161 'backdrop_filter_perf' ,
62+ needsMeasureCpuGPu: needsMeasureCpuGpu,
63+ ).run;
64+ }
65+
66+ TaskFunction createSimpleAnimationPerfTest ({bool needsMeasureCpuGpu = false }) {
67+ return PerfTest (
68+ '${flutterDirectory .path }/dev/benchmarks/macrobenchmarks' ,
69+ 'test_driver/simple_animation_perf.dart' ,
70+ 'simple_animation_perf' ,
71+ needsMeasureCpuGPu: needsMeasureCpuGpu,
6272 ).run;
6373}
6474
@@ -168,12 +178,18 @@ class StartupTest {
168178/// Measures application runtime performance, specifically per-frame
169179/// performance.
170180class PerfTest {
171- const PerfTest (this .testDirectory, this .testTarget, this .timelineFileName);
181+ const PerfTest (
182+ this .testDirectory,
183+ this .testTarget,
184+ this .timelineFileName,
185+ {this .needsMeasureCpuGPu = false });
172186
173187 final String testDirectory;
174188 final String testTarget;
175189 final String timelineFileName;
176190
191+ final bool needsMeasureCpuGPu;
192+
177193 Future <TaskResult > run () {
178194 return inDirectory <TaskResult >(testDirectory, () async {
179195 final Device device = await devices.workingDevice;
@@ -202,6 +218,12 @@ class PerfTest {
202218 );
203219 }
204220
221+ if (needsMeasureCpuGPu) {
222+ await inDirectory <void >('$testDirectory /build' , () async {
223+ data.addAll (await measureIosCpuGpu (deviceId: deviceId));
224+ });
225+ }
226+
205227 return TaskResult .success (data, benchmarkScoreKeys: < String > [
206228 'average_frame_build_time_millis' ,
207229 'worst_frame_build_time_millis' ,
@@ -213,6 +235,8 @@ class PerfTest {
213235 'missed_frame_rasterizer_budget_count' ,
214236 '90th_percentile_frame_rasterizer_time_millis' ,
215237 '99th_percentile_frame_rasterizer_time_millis' ,
238+ if (needsMeasureCpuGPu) 'cpu_percentage' ,
239+ if (needsMeasureCpuGPu) 'gpu_percentage' ,
216240 ]);
217241 });
218242 }
0 commit comments