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

Unified Diff: tools/perf/measurements/timeline_controller.py

Issue 439383002: Add GetThreadToInteractionRecordsMapsFromModel method to timeline_interaction_record. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months 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/measurements/thread_times.py ('k') | tools/perf/metrics/timeline.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/timeline_controller.py
diff --git a/tools/perf/measurements/timeline_controller.py b/tools/perf/measurements/timeline_controller.py
index 4cd0008b27de9fea89ba7ebe66f8e1593da1855e..b6381847d25e293006407bea970895ab78445ca0 100644
--- a/tools/perf/measurements/timeline_controller.py
+++ b/tools/perf/measurements/timeline_controller.py
@@ -49,15 +49,18 @@ class TimelineController(object):
# Stop tracing.
timeline_data = tab.browser.StopTracing()
self._model = TimelineModel(timeline_data)
- self._renderer_process = self._model.GetRendererProcessFromTabId(tab.id)
- renderer_thread = self.model.GetRendererThreadFromTabId(tab.id)
-
+ threads_to_records_map = (
+ tir_module.GetThreadToInteractionRecordsMapsFromModel(
+ self._model))
+ assert len(threads_to_records_map) == 1, (
+ 'timeline metrics only support interaction records issued from'
+ 'a single thread.')
+ renderer_thread = threads_to_records_map.keys()[0]
+ interaction_records = threads_to_records_map.values()[0]
+ self._renderer_process = renderer_thread.parent
run_smooth_actions_record = None
self._smooth_records = []
- for event in renderer_thread.async_slices:
- if not tir_module.IsTimelineInteractionRecord(event.name):
- continue
- r = tir_module.TimelineInteractionRecord.FromAsyncEvent(event)
+ for r in interaction_records:
if r.label == RUN_SMOOTH_ACTIONS:
assert run_smooth_actions_record is None, (
'TimelineController cannot issue more than 1 %s record' %
« no previous file with comments | « tools/perf/measurements/thread_times.py ('k') | tools/perf/metrics/timeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698