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
cf61905c
Commit
cf61905c
authored
Dec 13, 2016
by
Yegor
Committed by
GitHub
Dec 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
publish GPU metrics to dashboard; compact transition event printout (#7254)
parent
f2342a61
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
14 deletions
+49
-14
gallery.dart
dev/devicelab/lib/tasks/gallery.dart
+3
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+3
-0
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+43
-14
No files found.
dev/devicelab/lib/tasks/gallery.dart
View file @
cf61905c
...
...
@@ -61,6 +61,9 @@ class GalleryTransitionTest {
'average_frame_build_time_millis'
,
'worst_frame_build_time_millis'
,
'missed_frame_build_budget_count'
,
'average_frame_rasterizer_time_millis'
,
'worst_frame_rasterizer_time_millis'
,
'missed_frame_rasterizer_budget_count'
,
]);
}
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
cf61905c
...
...
@@ -143,6 +143,9 @@ class PerfTest {
'average_frame_build_time_millis'
,
'worst_frame_build_time_millis'
,
'missed_frame_build_budget_count'
,
'average_frame_rasterizer_time_millis'
,
'worst_frame_rasterizer_time_millis'
,
'missed_frame_rasterizer_budget_count'
,
]);
});
}
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
cf61905c
...
...
@@ -60,8 +60,10 @@ final List<String> demoTitles = <String>[
final
FileSystem
_fs
=
new
LocalFileSystem
();
/// Extracts event data from [events] recorded by timeline, validates it, turns
/// it into a histogram, and saves to a JSON file.
Future
<
Null
>
saveDurationsHistogram
(
List
<
Map
<
String
,
dynamic
>>
events
,
String
outputPath
)
async
{
final
Map
<
String
,
List
<
int
>>
durations
=
new
Map
<
String
,
List
<
int
>>()
;
final
Map
<
String
,
List
<
int
>>
durations
=
<
String
,
List
<
int
>>{}
;
Map
<
String
,
dynamic
>
startEvent
;
// Save the duration of the first frame after each 'Start Transition' event.
...
...
@@ -81,9 +83,42 @@ Future<Null> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
// Verify that the durations data is valid.
if
(
durations
.
keys
.
isEmpty
)
throw
'no "Start Transition" timeline events found'
;
for
(
String
routeName
in
durations
.
keys
)
{
if
(
durations
[
routeName
]
==
null
||
durations
[
routeName
].
length
!=
2
)
throw
'invalid timeline data for
$routeName
transition'
;
Map
<
String
,
int
>
unexpectedValueCounts
=
<
String
,
int
>{};
durations
.
forEach
((
String
routeName
,
List
<
int
>
values
)
{
if
(
values
.
length
!=
2
)
{
unexpectedValueCounts
[
routeName
]
=
values
.
length
;
}
});
if
(
unexpectedValueCounts
.
isNotEmpty
)
{
StringBuffer
error
=
new
StringBuffer
(
'Some routes recorded wrong number of values (expected 2 values/route):
\n\n
'
);
unexpectedValueCounts
.
forEach
((
String
routeName
,
int
count
)
{
error
.
writeln
(
' -
$routeName
recorded
$count
values.'
);
});
error
.
writeln
(
'
\n
Full event sequence:'
);
Iterator
<
Map
<
String
,
dynamic
>>
eventIter
=
events
.
iterator
;
String
lastEventName
=
''
;
String
lastRouteName
=
''
;
while
(
eventIter
.
moveNext
())
{
String
eventName
=
eventIter
.
current
[
'name'
];
if
(!<
String
>[
'Start Transition'
,
'Frame'
].
contains
(
eventName
))
continue
;
String
routeName
=
eventName
==
'Start Transition'
?
eventIter
.
current
[
'args'
][
'to'
]
:
''
;
if
(
eventName
==
lastEventName
&&
routeName
==
lastRouteName
)
{
error
.
write
(
'.'
);
}
else
{
error
.
write
(
'
\n
-
$eventName
$routeName
.'
);
}
lastEventName
=
eventName
;
lastRouteName
=
routeName
;
}
throw
error
;
}
// Save the durations Map to a file.
...
...
@@ -128,7 +163,8 @@ void main() {
}
},
streams:
const
<
TimelineStream
>[
TimelineStream
.
dart
TimelineStream
.
dart
,
TimelineStream
.
embedder
,
]);
// Save the duration (in microseconds) of the first timeline Frame event
...
...
@@ -136,15 +172,8 @@ void main() {
// 'Start Transition' event when a demo is launched (see GalleryItem).
TimelineSummary
summary
=
new
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeSummaryToFile
(
'transitions'
,
pretty:
true
);
try
{
String
histogramPath
=
path
.
join
(
testOutputsDirectory
,
'transition_durations.timeline.json'
);
await
saveDurationsHistogram
(
timeline
.
json
[
'traceEvents'
],
histogramPath
);
}
catch
(
_
)
{
await
summary
.
writeTimelineToFile
(
'transitions'
,
pretty:
true
);
print
(
'ERROR: failed to extract transition events. Here is the full timeline:
\n
'
);
print
(
await
_fs
.
file
(
'
$testOutputsDirectory
/transitions.timeline.json'
).
readAsString
());
rethrow
;
}
String
histogramPath
=
path
.
join
(
testOutputsDirectory
,
'transition_durations.timeline.json'
);
await
saveDurationsHistogram
(
timeline
.
json
[
'traceEvents'
],
histogramPath
);
},
timeout:
new
Timeout
(
new
Duration
(
minutes:
5
)));
});
}
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