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
37de94d7
Unverified
Commit
37de94d7
authored
Sep 02, 2020
by
gaaclarke
Committed by
GitHub
Sep 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devicelab: started averaging startup time for ios test (#64978)
parent
2e67bf2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
12 deletions
+36
-12
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+36
-12
No files found.
dev/devicelab/lib/tasks/perf_tests.dart
View file @
37de94d7
...
...
@@ -341,6 +341,23 @@ TaskFunction createFramePolicyIntegrationTest() {
};
}
Map
<
String
,
dynamic
>
_average
(
List
<
Map
<
String
,
dynamic
>>
results
,
int
iterations
)
{
final
Map
<
String
,
dynamic
>
tally
=
<
String
,
dynamic
>{};
for
(
final
Map
<
String
,
dynamic
>
item
in
results
)
{
item
.
forEach
((
String
key
,
dynamic
value
)
{
if
(
tally
.
containsKey
(
key
))
{
tally
[
key
]
=
(
tally
[
key
]
as
int
)
+
(
value
as
int
);
}
else
{
tally
[
key
]
=
value
;
}
});
}
tally
.
forEach
((
String
key
,
dynamic
value
)
{
tally
[
key
]
=
(
value
as
int
)
~/
iterations
;
});
return
tally
;
}
/// Measure application startup performance.
class
StartupTest
{
const
StartupTest
(
this
.
testDirectory
,
{
this
.
reportMetrics
=
true
});
...
...
@@ -353,21 +370,28 @@ class StartupTest {
final
String
deviceId
=
(
await
devices
.
workingDevice
).
deviceId
;
await
flutter
(
'packages'
,
options:
<
String
>[
'get'
]);
await
flutter
(
'run'
,
options:
<
String
>[
'--verbose'
,
'--profile'
,
'--trace-startup'
,
'-d'
,
deviceId
,
]);
final
Map
<
String
,
dynamic
>
data
=
json
.
decode
(
file
(
'
$testDirectory
/build/start_up_info.json'
).
readAsStringSync
(),
)
as
Map
<
String
,
dynamic
>;
const
int
iterations
=
3
;
final
List
<
Map
<
String
,
dynamic
>>
results
=
<
Map
<
String
,
dynamic
>>[];
for
(
int
i
=
0
;
i
<
iterations
;
++
i
)
{
await
flutter
(
'run'
,
options:
<
String
>[
'--verbose'
,
'--profile'
,
'--trace-startup'
,
'-d'
,
deviceId
,
]);
final
Map
<
String
,
dynamic
>
data
=
json
.
decode
(
file
(
'
$testDirectory
/build/start_up_info.json'
).
readAsStringSync
(),
)
as
Map
<
String
,
dynamic
>;
results
.
add
(
data
);
}
final
Map
<
String
,
dynamic
>
averageResults
=
_average
(
results
,
iterations
);
if
(!
reportMetrics
)
return
TaskResult
.
success
(
data
);
return
TaskResult
.
success
(
averageResults
);
return
TaskResult
.
success
(
data
,
benchmarkScoreKeys:
<
String
>[
return
TaskResult
.
success
(
averageResults
,
benchmarkScoreKeys:
<
String
>[
'timeToFirstFrameMicros'
,
'timeToFirstFrameRasterizedMicros'
,
]);
...
...
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