Merge pull request #3058 from yjbanov/timeline-summary

[driver] utility for extracting and saving timeline summary
This commit is contained in:
Yegor
2016-04-01 17:48:25 -07:00
parent 71e689f450
commit 055fd00dc1
8 changed files with 306 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ void main() {
});
test('measure', () async {
Map<String, dynamic> profileJson = await driver.traceAction(() async {
Map<String, dynamic> timeline = await driver.traceAction(() async {
// Find the scrollable stock list
ObjectRef stockList = await driver.findByValueKey('stock-list');
expect(stockList, isNotNull);
@@ -39,10 +39,10 @@ void main() {
}
});
// Usually the profile is saved to a file and then analyzed using
// chrom://tracing or a script. Both are out of scope for this little
// test, so all we do is check that we received something.
expect(profileJson, isNotNull);
expect(timeline, isNotNull);
TimelineSummary summary = summarizeTimeline(timeline);
summary.writeSummaryToFile('stocks_scroll_perf', pretty: true);
summary.writeTimelineToFile('stocks_scroll_perf', pretty: true);
});
});
}