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
b6ac8643
Commit
b6ac8643
authored
Jan 10, 2017
by
Yegor
Committed by
GitHub
Jan 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export missed transition count to the dashboard (#7426)
parent
90d18fa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
gallery.dart
dev/devicelab/lib/tasks/gallery.dart
+18
-2
No files found.
dev/devicelab/lib/tasks/gallery.dart
View file @
b6ac8643
...
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'dart:math'
as
math
;
import
'../framework/adb.dart'
;
import
'../framework/framework.dart'
;
...
...
@@ -42,10 +43,10 @@ class GalleryTransitionTest {
// Route paths contains slashes, which Firebase doesn't accept in keys, so we
// remove them.
Map
<
String
,
dynamic
>
original
=
JSON
.
decode
(
file
(
Map
<
String
,
List
<
int
>
>
original
=
JSON
.
decode
(
file
(
'
${galleryDirectory.path}
/build/transition_durations.timeline.json'
)
.
readAsStringSync
());
Map
<
String
,
dynamic
>
transitions
=
new
Map
<
String
,
dynamic
>.
fromIterable
(
Map
<
String
,
List
<
int
>>
transitions
=
new
Map
<
String
,
List
<
int
>
>.
fromIterable
(
original
.
keys
,
key:
(
String
key
)
=>
key
.
replaceAll
(
'/'
,
''
),
value:
(
String
key
)
=>
original
[
key
]);
...
...
@@ -54,10 +55,12 @@ class GalleryTransitionTest {
Map
<
String
,
dynamic
>
data
=
<
String
,
dynamic
>{
'transitions'
:
transitions
,
'missed_transition_count'
:
_countMissedTransitions
(
transitions
),
};
data
.
addAll
(
summary
);
return
new
TaskResult
.
success
(
data
,
benchmarkScoreKeys:
<
String
>[
'missed_transition_count'
,
'average_frame_build_time_millis'
,
'worst_frame_build_time_millis'
,
'missed_frame_build_budget_count'
,
...
...
@@ -67,3 +70,16 @@ class GalleryTransitionTest {
]);
}
}
int
_countMissedTransitions
(
Map
<
String
,
List
<
int
>>
transitions
)
{
const
int
_kTransitionBudget
=
100000
;
// µs
int
count
=
0
;
transitions
.
forEach
((
String
demoName
,
List
<
int
>
durations
)
{
int
longestDuration
=
durations
.
reduce
(
math
.
max
);
if
(
longestDuration
>
_kTransitionBudget
)
{
print
(
'
$demoName
missed transition time budget (
$longestDuration
µs >
$_kTransitionBudget
µs)'
);
count
++;
}
});
return
count
;
}
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