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
d377c1ba
Unverified
Commit
d377c1ba
authored
Mar 31, 2021
by
Dan Field
Committed by
GitHub
Mar 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always write full timeline before summary (#79310)
parent
6b3093b6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
46 additions
and
11 deletions
+46
-11
scroll_perf_test.dart
...nchmarks/complex_layout/test_driver/scroll_perf_test.dart
+0
-1
large_image_changer_test.dart
...macrobenchmarks/test_driver/large_image_changer_test.dart
+0
-1
util.dart
dev/benchmarks/macrobenchmarks/test_driver/util.dart
+0
-1
scroll_perf_test.dart
...s/platform_views_layout/test_driver/scroll_perf_test.dart
+0
-1
scroll_perf_test.dart
...yout_hybrid_composition/test_driver/scroll_perf_test.dart
+0
-1
scroll_perf_test.dart
...hmarks/test_apps/stocks/test_driver/scroll_perf_test.dart
+0
-1
scroll_perf_test.dart
...n_tests/flutter_gallery/test_driver/scroll_perf_test.dart
+0
-1
transitions_perf_test.dart
...ts/flutter_gallery/test_driver/transitions_perf_test.dart
+0
-1
timeline_summary.dart
packages/flutter_driver/lib/src/driver/timeline_summary.dart
+21
-0
timeline_summary_test.dart
...ter_driver/test/src/real_tests/timeline_summary_test.dart
+25
-3
No files found.
dev/benchmarks/complex_layout/test_driver/scroll_perf_test.dart
View file @
d377c1ba
...
...
@@ -50,7 +50,6 @@ void main() {
});
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeSummaryToFile
(
summaryName
,
pretty:
true
);
await
summary
.
writeTimelineToFile
(
summaryName
,
pretty:
true
);
}
...
...
dev/benchmarks/macrobenchmarks/test_driver/large_image_changer_test.dart
View file @
d377c1ba
...
...
@@ -36,7 +36,6 @@ Future<void> main() async {
if
(
timeline
!=
null
)
{
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeSummaryToFile
(
fileName
,
pretty:
true
);
await
summary
.
writeTimelineToFile
(
fileName
,
pretty:
true
);
}
...
...
dev/benchmarks/macrobenchmarks/test_driver/util.dart
View file @
d377c1ba
...
...
@@ -67,7 +67,6 @@ void macroPerfTest(
expect
(
timeline
,
isNotNull
);
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeSummaryToFile
(
testName
,
pretty:
true
);
await
summary
.
writeTimelineToFile
(
testName
,
pretty:
true
);
},
timeout:
Timeout
(
timeout
));
}
dev/benchmarks/platform_views_layout/test_driver/scroll_perf_test.dart
View file @
d377c1ba
...
...
@@ -47,7 +47,6 @@ void main() {
});
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeSummaryToFile
(
summaryName
,
pretty:
true
);
await
summary
.
writeTimelineToFile
(
summaryName
,
pretty:
true
);
}
...
...
dev/benchmarks/platform_views_layout_hybrid_composition/test_driver/scroll_perf_test.dart
View file @
d377c1ba
...
...
@@ -47,7 +47,6 @@ void main() {
});
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
summary
.
writeSummaryToFile
(
summaryName
,
pretty:
true
);
summary
.
writeTimelineToFile
(
summaryName
,
pretty:
true
);
}
...
...
dev/benchmarks/test_apps/stocks/test_driver/scroll_perf_test.dart
View file @
d377c1ba
...
...
@@ -40,7 +40,6 @@ void main() {
});
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeSummaryToFile
(
'stocks_scroll_perf'
,
pretty:
true
);
await
summary
.
writeTimelineToFile
(
'stocks_scroll_perf'
,
pretty:
true
);
});
});
...
...
dev/integration_tests/flutter_gallery/test_driver/scroll_perf_test.dart
View file @
d377c1ba
...
...
@@ -44,7 +44,6 @@ void main() {
});
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeSummaryToFile
(
'home_scroll_perf'
,
pretty:
true
);
await
summary
.
writeTimelineToFile
(
'home_scroll_perf'
,
pretty:
true
);
});
});
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
d377c1ba
...
...
@@ -207,7 +207,6 @@ void main([List<String> args = const <String>[]]) {
// that follows a 'Start Transition' event. The Gallery app adds a
// 'Start Transition' event when a demo is launched (see GalleryItem).
final
TimelineSummary
summary
=
TimelineSummary
.
summarize
(
timeline
);
await
summary
.
writeSummaryToFile
(
'transitions'
,
pretty:
true
);
await
summary
.
writeTimelineToFile
(
'transitions'
,
pretty:
true
);
final
String
histogramPath
=
path
.
join
(
testOutputsDirectory
,
'transition_durations.timeline.json'
);
await
saveDurationsHistogram
(
...
...
packages/flutter_driver/lib/src/driver/timeline_summary.dart
View file @
d377c1ba
...
...
@@ -202,6 +202,10 @@ class TimelineSummary {
/// Writes all of the recorded timeline data to a file.
///
/// By default, this will dump [summaryJson] to a companion file named
/// `$traceName.timeline_summary.json`. If you want to skip the summary, set
/// the `includeSummary` parameter to false.
///
/// See also:
///
/// * [Timeline.fromJson], which explains detail about the timeline data.
...
...
@@ -209,20 +213,37 @@ class TimelineSummary {
String
traceName
,
{
String
?
destinationDirectory
,
bool
pretty
=
false
,
bool
includeSummary
=
true
,
})
async
{
destinationDirectory
??=
testOutputsDirectory
;
await
fs
.
directory
(
destinationDirectory
).
create
(
recursive:
true
);
final
File
file
=
fs
.
file
(
path
.
join
(
destinationDirectory
,
'
$traceName
.timeline.json'
));
await
file
.
writeAsString
(
_encodeJson
(
_timeline
.
json
,
pretty
));
if
(
includeSummary
)
{
await
_writeSummaryToFile
(
traceName
,
destinationDirectory:
destinationDirectory
,
pretty:
pretty
);
}
}
/// Writes [summaryJson] to a file.
@Deprecated
(
'Use TimelineSummary.writeTimelineToFile. '
'This feature was deprecated after v2.1.0-13.0.pre.'
)
Future
<
void
>
writeSummaryToFile
(
String
traceName
,
{
String
?
destinationDirectory
,
bool
pretty
=
false
,
})
async
{
destinationDirectory
??=
testOutputsDirectory
;
await
_writeSummaryToFile
(
traceName
,
destinationDirectory:
destinationDirectory
,
pretty:
pretty
);
}
Future
<
void
>
_writeSummaryToFile
(
String
traceName
,
{
required
String
destinationDirectory
,
bool
pretty
=
false
,
})
async
{
await
fs
.
directory
(
destinationDirectory
).
create
(
recursive:
true
);
final
File
file
=
fs
.
file
(
path
.
join
(
destinationDirectory
,
'
$traceName
.timeline_summary.json'
));
await
file
.
writeAsString
(
_encodeJson
(
summaryJson
,
pretty
));
...
...
packages/flutter_driver/test/src/real_tests/timeline_summary_test.dart
View file @
d377c1ba
...
...
@@ -434,14 +434,36 @@ void main() {
restoreFileSystem
();
});
test
(
'writes timeline to JSON file'
,
()
async
{
test
(
'writes timeline to JSON file
without summary
'
,
()
async
{
await
summarize
(<
Map
<
String
,
String
>>[<
String
,
String
>{
'foo'
:
'bar'
}])
.
writeTimelineToFile
(
'test'
,
destinationDirectory:
tempDir
.
path
);
.
writeTimelineToFile
(
'test'
,
destinationDirectory:
tempDir
.
path
,
includeSummary:
false
);
final
String
written
=
await
fs
.
file
(
path
.
join
(
tempDir
.
path
,
'test.timeline.json'
)).
readAsString
();
expect
(
written
,
'{"traceEvents":[{"foo":"bar"}]}'
);
});
test
(
'writes timeline to JSON file with summary'
,
()
async
{
await
summarize
(<
Map
<
String
,
dynamic
>>[
<
String
,
String
>{
'foo'
:
'bar'
},
begin
(
1000
),
end
(
19000
),
frameBegin
(
1000
),
frameEnd
(
18000
),
]).
writeTimelineToFile
(
'test'
,
destinationDirectory:
tempDir
.
path
,
includeSummary:
true
,
);
final
String
written
=
await
fs
.
file
(
path
.
join
(
tempDir
.
path
,
'test.timeline.json'
)).
readAsString
();
expect
(
written
,
'{"traceEvents":[{"foo":"bar"},'
'{"name":"GPURasterizer::Draw","ph":"B","ts":1000},'
'{"name":"GPURasterizer::Draw","ph":"E","ts":19000},'
'{"name":"Frame","ph":"B","ts":1000},'
'{"name":"Frame","ph":"E","ts":18000}]}'
,
);
});
test
(
'writes summary to JSON file'
,
()
async
{
await
summarize
(<
Map
<
String
,
dynamic
>>[
begin
(
1000
),
end
(
19000
),
...
...
@@ -456,7 +478,7 @@ void main() {
cpuUsage
(
5000
,
20
),
cpuUsage
(
5010
,
60
),
memoryUsage
(
6000
,
20
,
40
),
memoryUsage
(
6100
,
30
,
45
),
platformVsync
(
7000
),
vsyncCallback
(
7500
),
]).
write
Summary
ToFile
(
'test'
,
destinationDirectory:
tempDir
.
path
);
]).
write
Timeline
ToFile
(
'test'
,
destinationDirectory:
tempDir
.
path
);
final
String
written
=
await
fs
.
file
(
path
.
join
(
tempDir
.
path
,
'test.timeline_summary.json'
)).
readAsString
();
expect
(
json
.
decode
(
written
),
<
String
,
dynamic
>{
...
...
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