Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Unified Diff: tools/telemetry/telemetry/core/timeline/model.py

Issue 59403008: telemetry: Add RenderingStatsUnitTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/metrics/rendering_stats_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/timeline/model.py
diff --git a/tools/telemetry/telemetry/core/timeline/model.py b/tools/telemetry/telemetry/core/timeline/model.py
index 61ab315f968555387683dce9881d21b961c48604..f31d44a46fadaff9125319d3794ee059ad5f1677 100644
--- a/tools/telemetry/telemetry/core/timeline/model.py
+++ b/tools/telemetry/telemetry/core/timeline/model.py
@@ -139,30 +139,33 @@ class TimelineModel(object):
self._processes[pid] = tracing_process.Process(self, pid)
return self._processes[pid]
- def FindTimelineMarkers(self, timeline_marker_labels):
+ def FindTimelineMarkers(self, timeline_marker_names):
"""Find the timeline events with the given names.
- If the number and order of events found does not match the labels,
+ If the number and order of events found does not match the names,
raise an error.
"""
- # Make sure labels are in a list and remove all None labels
- if not isinstance(timeline_marker_labels, list):
- timeline_marker_labels = [timeline_marker_labels]
- labels = [x for x in timeline_marker_labels if x is not None]
+ # Make sure names are in a list and remove all None names
+ if not isinstance(timeline_marker_names, list):
+ timeline_marker_names = [timeline_marker_names]
+ names = [x for x in timeline_marker_names if x is not None]
- # Gather all events that match the labels and sort them.
+ # Gather all events that match the names and sort them.
events = []
- for label in labels:
- events.extend([s for s in self.GetAllEventsOfName(label)
+ name_set = set()
+ for name in names:
+ name_set.add(name)
+ for name in name_set:
+ events.extend([s for s in self.GetAllEventsOfName(name)
if s.parent_slice == None])
events.sort(key=attrgetter('start'))
- # Check if the number and order of events matches the provided labels,
+ # Check if the number and order of events matches the provided names,
# and that the events don't overlap.
- if len(events) != len(labels):
+ if len(events) != len(names):
raise MarkerMismatchError()
for (i, event) in enumerate(events):
- if event.name != labels[i]:
+ if event.name != names[i]:
raise MarkerMismatchError()
for i in xrange(0, len(events)):
for j in xrange(i+1, len(events)):
« no previous file with comments | « tools/perf/metrics/rendering_stats_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698