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
78951b0c
Unverified
Commit
78951b0c
authored
Dec 10, 2019
by
Jonah Williams
Committed by
GitHub
Dec 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[benchmarks] Add time to development benchmark for Android (#46717)
parent
dfcd6568
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
0 deletions
+86
-0
time_to_development_benchmark__android.dart
...lab/bin/tasks/time_to_development_benchmark__android.dart
+80
-0
manifest.yaml
dev/devicelab/manifest.yaml
+6
-0
No files found.
dev/devicelab/bin/tasks/time_to_development_benchmark__android.dart
0 → 100644
View file @
78951b0c
// Copyright 2014 The Flutter 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:io'
;
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
import
'package:path/path.dart'
as
path
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createTimeToDevelopmentCommand
);
}
final
Directory
flutterGalleryDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'examples'
,
'flutter_gallery'
));
final
Directory
editedFlutterGalleryDir
=
dir
(
path
.
join
(
Directory
.
systemTemp
.
path
,
'edited_flutter_gallery'
));
Future
<
TaskResult
>
createTimeToDevelopmentCommand
()
async
{
final
Map
<
String
,
double
>
allResults
=
<
String
,
double
>{};
bool
failed
=
false
;
await
inDirectory
<
void
>(
flutterDirectory
,
()
async
{
rmTree
(
editedFlutterGalleryDir
);
mkdirs
(
editedFlutterGalleryDir
);
recursiveCopy
(
flutterGalleryDir
,
editedFlutterGalleryDir
);
await
inDirectory
<
void
>(
editedFlutterGalleryDir
,
()
async
{
final
Device
device
=
await
devices
.
workingDevice
;
await
device
.
unlock
();
final
Stopwatch
stopwatch
=
Stopwatch
()..
start
();
final
Process
initialBuild
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
,
'--debug'
,
'-d'
,
device
.
deviceId
,
'--no-resident'
,],
);
int
exitCode
=
await
initialBuild
.
exitCode
;
if
(
exitCode
!=
0
)
{
failed
=
true
;
return
;
}
final
int
initialBuildMilliseconds
=
stopwatch
.
elapsedMilliseconds
;
stopwatch
..
reset
()
..
start
();
// Update a source file.
final
File
appDartSource
=
file
(
path
.
join
(
editedFlutterGalleryDir
.
path
,
'lib/gallery/app.dart'
,
));
appDartSource
.
writeAsStringSync
(
appDartSource
.
readAsStringSync
().
replaceFirst
(
"'Flutter Gallery'"
,
"'Updated Flutter Gallery'"
,
),
);
final
Process
secondBuild
=
await
startProcess
(
path
.
join
(
flutterDirectory
.
path
,
'bin'
,
'flutter'
),
<
String
>[
'run'
,
'--debug'
,
'-d'
,
device
.
deviceId
,
'--no-resident'
],
environment:
null
,
);
exitCode
=
await
secondBuild
.
exitCode
;
if
(
exitCode
!=
0
)
{
failed
=
true
;
return
;
}
stopwatch
.
stop
();
allResults
[
'time_to_development'
]
=
initialBuildMilliseconds
.
toDouble
();
allResults
[
'time_to_development_incremental'
]
=
stopwatch
.
elapsedMilliseconds
.
toDouble
();
});
});
if
(
failed
)
{
return
TaskResult
.
failure
(
'Failed to build debug app'
);
}
return
TaskResult
.
success
(
allResults
,
benchmarkScoreKeys:
allResults
.
keys
.
toList
());
}
dev/devicelab/manifest.yaml
View file @
78951b0c
...
@@ -382,6 +382,12 @@ tasks:
...
@@ -382,6 +382,12 @@ tasks:
stage
:
devicelab
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
required_agent_capabilities
:
[
"
linux/android"
]
time_to_development_benchmark__android
:
description
:
>
Measures time from flutter run until resident runner setup is complete.
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
# iOS on-device tests
# iOS on-device tests
tiles_scroll_perf_ios__timeline_summary
:
tiles_scroll_perf_ios__timeline_summary
:
...
...
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