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

Side by Side Diff: tools/perf/measurements/timeline_based_measurement.py

Issue 208643007: Add cleanup for measurements that use tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from metrics import timeline as timeline_module 5 from metrics import timeline as timeline_module
6 from metrics import timeline_interaction_record as tir_module 6 from metrics import timeline_interaction_record as tir_module
7 from metrics import smoothness 7 from metrics import smoothness
8 from telemetry.page import page_measurement 8 from telemetry.page import page_measurement
9 from telemetry.core.timeline import model as model_module 9 from telemetry.core.timeline import model as model_module
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 categories = ','.join([categories] + page.GetSyntheticDelayCategories()) 116 categories = ','.join([categories] + page.GetSyntheticDelayCategories())
117 tab.browser.StartTracing(categories) 117 tab.browser.StartTracing(categories)
118 118
119 def MeasurePage(self, page, tab, results): 119 def MeasurePage(self, page, tab, results):
120 """ Collect all possible metrics and added them to results. """ 120 """ Collect all possible metrics and added them to results. """
121 trace_result = tab.browser.StopTracing() 121 trace_result = tab.browser.StopTracing()
122 model = model_module.TimelineModel(trace_result) 122 model = model_module.TimelineModel(trace_result)
123 renderer_thread = model.GetRendererThreadFromTab(tab) 123 renderer_thread = model.GetRendererThreadFromTab(tab)
124 meta_metrics = _TimelineBasedMetrics(model, renderer_thread) 124 meta_metrics = _TimelineBasedMetrics(model, renderer_thread)
125 meta_metrics.AddResults(results) 125 meta_metrics.AddResults(results)
126
127 def CleanUpAfterPage(self, page, tab):
128 if tab.browser.is_tracing_running:
129 tab.browser.StopTracing()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698