Unverified Commit e9e8ca76 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Add debug_second_compile_millis benchmark metric (#77420)

parent c9d68ba7
......@@ -1000,9 +1000,21 @@ class CompileTest {
await device.unlock();
await flutter('packages', options: <String>['get']);
final Map<String, dynamic> compileRelease = await _compileApp(reportPackageContentSizes: reportPackageContentSizes);
final Map<String, dynamic> compileDebug = await _compileDebug(
clean: true,
metricKey: 'debug_full_compile_millis',
);
// Build again without cleaning, should be faster.
final Map<String, dynamic> compileSecondDebug = await _compileDebug(
clean: false,
metricKey: 'debug_second_compile_millis',
);
final Map<String, dynamic> metrics = <String, dynamic>{
...await _compileApp(reportPackageContentSizes: reportPackageContentSizes),
...await _compileDebug(),
...compileRelease,
...compileDebug,
...compileSecondDebug,
};
return TaskResult.success(metrics, benchmarkScoreKeys: metrics.keys.toList());
......@@ -1082,8 +1094,13 @@ class CompileTest {
return metrics;
}
static Future<Map<String, dynamic>> _compileDebug() async {
await flutter('clean');
static Future<Map<String, dynamic>> _compileDebug({
@required bool clean,
@required String metricKey,
}) async {
if (clean) {
await flutter('clean');
}
final Stopwatch watch = Stopwatch();
final List<String> options = <String>['--debug'];
switch (deviceOperatingSystem) {
......@@ -1109,7 +1126,7 @@ class CompileTest {
watch.stop();
return <String, dynamic>{
'debug_full_compile_millis': watch.elapsedMilliseconds,
metricKey: watch.elapsedMilliseconds,
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment