Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
91e3b2d6
Unverified
Commit
91e3b2d6
authored
Jul 09, 2019
by
Jonah Williams
Committed by
GitHub
Jul 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add iOS build benchmarks (#35749)
parent
0e7cfc1e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
58 deletions
+88
-58
build_benchmark.dart
dev/devicelab/bin/tasks/build_benchmark.dart
+1
-1
build_benchmark_ios.dart
dev/devicelab/bin/tasks/build_benchmark_ios.dart
+12
-0
build_benchmarks.dart
dev/devicelab/lib/tasks/build_benchmarks.dart
+68
-57
manifest.yaml
dev/devicelab/manifest.yaml
+7
-0
No files found.
dev/devicelab/bin/tasks/build_benchmark.dart
View file @
91e3b2d6
...
...
@@ -8,5 +8,5 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/tasks/build_benchmarks.dart'
;
Future
<
void
>
main
()
async
{
await
task
(
create
Buildb
enchmarkTask
());
await
task
(
create
AndroidBuildB
enchmarkTask
());
}
dev/devicelab/bin/tasks/build_benchmark_ios.dart
0 → 100644
View file @
91e3b2d6
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/build_benchmarks.dart'
;
Future
<
void
>
main
()
async
{
await
task
(
createIosBuildBenchmarkTask
());
}
dev/devicelab/lib/tasks/build_benchmarks.dart
View file @
91e3b2d6
...
...
@@ -10,63 +10,74 @@ import 'package:path/path.dart' as path;
final
Directory
helloWorldDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'examples'
,
'hello_world'
));
/// Creates a device
lab build benchmark
.
TaskFunction
create
Buildb
enchmarkTask
(
)
{
/// Creates a device
lab build benchmark for Android
.
TaskFunction
create
AndroidBuildB
enchmarkTask
(
)
{
return
()
async
{
return
inDirectory
<
TaskResult
>(
helloWorldDir
,
()
async
{
final
Stopwatch
stopwatch
=
Stopwatch
()
..
start
();
final
Process
initialBuild
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'build'
,
'apk'
,
'--debug'
],
environment:
null
,
);
int
exitCode
=
await
initialBuild
.
exitCode
;
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to build debug APK'
);
}
final
int
initialBuildMilliseconds
=
stopwatch
.
elapsedMilliseconds
;
stopwatch
..
reset
()
..
start
();
final
Process
secondBuild
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'build'
,
'apk'
,
'--debug'
],
environment:
null
,
);
exitCode
=
await
secondBuild
.
exitCode
;
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to build debug APK'
);
}
final
int
secondBuildMilliseconds
=
stopwatch
.
elapsedMilliseconds
;
final
Process
newBuildConfig
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'build'
,
'apk'
,
'--profile'
],
environment:
null
,
);
exitCode
=
await
newBuildConfig
.
exitCode
;
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to build profile APK'
);
}
stopwatch
..
reset
()
..
start
();
final
Process
thirdBuild
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'build'
,
'apk'
,
'--debug'
],
environment:
null
,
);
exitCode
=
await
thirdBuild
.
exitCode
;
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to build debug APK'
);
}
final
int
thirdBuildMilliseconds
=
stopwatch
.
elapsedMilliseconds
;
stopwatch
.
stop
();
final
Map
<
String
,
double
>
allResults
=
<
String
,
double
>{};
allResults
[
'first_build_debug_millis'
]
=
initialBuildMilliseconds
.
toDouble
();
allResults
[
'second_build_debug_millis'
]
=
secondBuildMilliseconds
.
toDouble
();
allResults
[
'after_config_change_build_debug_millis'
]
=
thirdBuildMilliseconds
.
toDouble
();
return
TaskResult
.
success
(
allResults
,
benchmarkScoreKeys:
allResults
.
keys
.
toList
());
});
return
createBuildCommand
(
'apk'
);
};
}
/// Creates a devicelab build benchmark for iOS.
TaskFunction
createIosBuildBenchmarkTask
(
)
{
return
()
async
{
return
createBuildCommand
(
'ios'
);
};
}
Future
<
TaskResult
>
createBuildCommand
(
String
buildKind
)
{
return
inDirectory
<
TaskResult
>(
helloWorldDir
,
()
async
{
final
Stopwatch
stopwatch
=
Stopwatch
()
..
start
();
final
Process
initialBuild
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'build'
,
buildKind
,
'--debug'
],
environment:
null
,
);
int
exitCode
=
await
initialBuild
.
exitCode
;
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to build debug app'
);
}
final
int
initialBuildMilliseconds
=
stopwatch
.
elapsedMilliseconds
;
stopwatch
..
reset
()
..
start
();
final
Process
secondBuild
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'build'
,
buildKind
,
'--debug'
],
environment:
null
,
);
exitCode
=
await
secondBuild
.
exitCode
;
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to build debug app'
);
}
final
int
secondBuildMilliseconds
=
stopwatch
.
elapsedMilliseconds
;
final
Process
newBuildConfig
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'build'
,
buildKind
,
'--profile'
],
environment:
null
,
);
exitCode
=
await
newBuildConfig
.
exitCode
;
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to build profile app'
);
}
stopwatch
..
reset
()
..
start
();
final
Process
thirdBuild
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'build'
,
buildKind
,
'--debug'
],
environment:
null
,
);
exitCode
=
await
thirdBuild
.
exitCode
;
if
(
exitCode
!=
0
)
{
return
TaskResult
.
failure
(
'Failed to build debug app'
);
}
final
int
thirdBuildMilliseconds
=
stopwatch
.
elapsedMilliseconds
;
stopwatch
.
stop
();
final
Map
<
String
,
double
>
allResults
=
<
String
,
double
>{};
allResults
[
'first_build_debug_millis'
]
=
initialBuildMilliseconds
.
toDouble
();
allResults
[
'second_build_debug_millis'
]
=
secondBuildMilliseconds
.
toDouble
();
allResults
[
'after_config_change_build_debug_millis'
]
=
thirdBuildMilliseconds
.
toDouble
();
return
TaskResult
.
success
(
allResults
,
benchmarkScoreKeys:
allResults
.
keys
.
toList
());
});
}
dev/devicelab/manifest.yaml
View file @
91e3b2d6
...
...
@@ -489,6 +489,13 @@ tasks:
required_agent_capabilities
:
[
"
mac/ios"
]
flaky
:
true
build_benchmark_ios
:
description
:
>
Measures iOS build performance across config changes.
stage
:
devicelab_ios
required_agent_capabilities
:
[
"
mac/ios"
]
flaky
:
true
# Tests running on Windows host
flavors_test_win
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment