Unverified Commit cb88d2a3 authored by Kaushik Iska's avatar Kaushik Iska Committed by GitHub

Revert "[timeline] Sort timeline events before summarizing (#55763)" (#55769)

This reverts commit 26516817.
Co-authored-by: 's avatarKaushik Iska <kaushikiska@google.com>
parent be0076f3
......@@ -34,8 +34,12 @@ class TimelineEvent {
json['ph'] as String,
json['pid'] as int,
json['tid'] as int,
json['dur'] != null ? Duration(microseconds: json['dur'] as int) : null,
json['tdur'] != null ? Duration(microseconds: json['tdur'] as int) : null,
json['dur'] != null
? Duration(microseconds: json['dur'] as int)
: null,
json['tdur'] != null
? Duration(microseconds: json['tdur'] as int)
: null,
json['ts'] as int,
json['tts'] as int,
json['args'] as Map<String, dynamic>,
......@@ -120,20 +124,11 @@ class TimelineEvent {
List<TimelineEvent> _parseEvents(Map<String, dynamic> json) {
final List<dynamic> jsonEvents = json['traceEvents'] as List<dynamic>;
if (jsonEvents == null) {
if (jsonEvents == null)
return null;
}
// TODO(vegorov): use instance method version of castFrom when it is available.
final List<TimelineEvent> timelineEvents =
Iterable.castFrom<dynamic, Map<String, dynamic>>(jsonEvents)
.map<TimelineEvent>(
(Map<String, dynamic> eventJson) => TimelineEvent(eventJson))
.toList();
timelineEvents.sort((TimelineEvent e1, TimelineEvent e2) {
return e1.timestampMicros.compareTo(e2.timestampMicros);
});
return timelineEvents;
return Iterable.castFrom<dynamic, Map<String, dynamic>>(jsonEvents)
.map<TimelineEvent>((Map<String, dynamic> eventJson) => TimelineEvent(eventJson))
.toList();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment