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
54d75a51
Unverified
Commit
54d75a51
authored
Apr 02, 2020
by
liyuqian
Committed by
GitHub
Apr 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print frame begin time in summary (#50272)
parent
19e7db58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
timeline_summary.dart
packages/flutter_driver/lib/src/driver/timeline_summary.dart
+35
-5
timeline_summary_test.dart
...ter_driver/test/src/real_tests/timeline_summary_test.dart
+2
-0
No files found.
packages/flutter_driver/lib/src/driver/timeline_summary.dart
View file @
54d75a51
...
...
@@ -103,6 +103,9 @@ class TimelineSummary {
'frame_rasterizer_times'
:
_extractGpuRasterizerDrawDurations
()
.
map
<
int
>((
Duration
duration
)
=>
duration
.
inMicroseconds
)
.
toList
(),
'frame_begin_times'
:
_extractBeginTimestamps
(
'Frame'
)
.
map
<
int
>((
Duration
duration
)
=>
duration
.
inMicroseconds
)
.
toList
()
};
}
...
...
@@ -142,10 +145,10 @@ class TimelineSummary {
.
toList
();
}
/// Extracts Duration list that are reported as a pair of begin/end events.
///
/// See: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU
List
<
Duration
>
_extractBeginEndEvents
(
String
name
)
{
List
<
Duration
>
_extractDurations
(
String
name
,
Duration
extractor
(
TimelineEvent
beginEvent
,
TimelineEvent
endEvent
),
)
{
final
List
<
Duration
>
result
=
<
Duration
>[];
// Timeline does not guarantee that the first event is the "begin" event.
...
...
@@ -155,13 +158,40 @@ class TimelineSummary {
final
TimelineEvent
beginEvent
=
events
.
current
;
if
(
events
.
moveNext
())
{
final
TimelineEvent
endEvent
=
events
.
current
;
result
.
add
(
Duration
(
microseconds:
endEvent
.
timestampMicros
-
beginEvent
.
timestampMicros
));
result
.
add
(
extractor
(
beginEvent
,
endEvent
));
}
}
return
result
;
}
/// Extracts Duration list that are reported as a pair of begin/end events.
///
/// See: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU
List
<
Duration
>
_extractBeginEndEvents
(
String
name
)
{
return
_extractDurations
(
name
,
(
TimelineEvent
beginEvent
,
TimelineEvent
endEvent
)
{
return
Duration
(
microseconds:
endEvent
.
timestampMicros
-
beginEvent
.
timestampMicros
);
},
);
}
List
<
Duration
>
_extractBeginTimestamps
(
String
name
)
{
final
List
<
Duration
>
result
=
_extractDurations
(
name
,
(
TimelineEvent
beginEvent
,
TimelineEvent
endEvent
)
{
return
Duration
(
microseconds:
beginEvent
.
timestampMicros
);
},
);
// Align timestamps so the first event is at 0.
for
(
int
i
=
result
.
length
-
1
;
i
>=
0
;
i
-=
1
)
{
result
[
i
]
=
result
[
i
]
-
result
[
0
];
}
return
result
;
}
double
_averageInMillis
(
Iterable
<
Duration
>
durations
)
{
if
(
durations
.
isEmpty
)
throw
ArgumentError
(
'durations is empty!'
);
...
...
packages/flutter_driver/test/src/real_tests/timeline_summary_test.dart
View file @
54d75a51
...
...
@@ -330,6 +330,7 @@ void main() {
'frame_count'
:
3
,
'frame_build_times'
:
<
int
>[
17000
,
9000
,
19000
],
'frame_rasterizer_times'
:
<
int
>[
18000
,
10000
,
20000
],
'frame_begin_times'
:
<
int
>[
0
,
18000
,
28000
],
},
);
});
...
...
@@ -382,6 +383,7 @@ void main() {
'frame_count'
:
3
,
'frame_build_times'
:
<
int
>[
17000
,
9000
,
19000
],
'frame_rasterizer_times'
:
<
int
>[
18000
,
10000
,
20000
],
'frame_begin_times'
:
<
int
>[
0
,
18000
,
28000
],
});
});
});
...
...
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