Use async timeline events for the phases of the scheduler binding (#88825)

This commit is contained in:
Jason Simmons
2021-09-10 10:17:05 -07:00
committed by GitHub
parent 7736b9eef0
commit 2004afae06
5 changed files with 38 additions and 12 deletions

View File

@@ -37,11 +37,11 @@ Future<void> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
} else if (startEvent != null && eventName == 'Frame') {
final String phase = event['ph'] as String;
final int timestamp = event['ts'] as int;
if (phase == 'B') {
if (phase == 'B' || phase == 'b') {
assert(frameStart == null);
frameStart = timestamp;
} else {
assert(phase == 'E');
assert(phase == 'E' || phase == 'e');
final String routeName = (startEvent['args'] as Map<String, dynamic>)['to'] as String;
durations[routeName] ??= <int>[];
durations[routeName]!.add(timestamp - frameStart!);