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

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

Issue 853353005: [Telemetry] Add tracing_agent API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittest breakage (bug in tracing_controller_backend) Created 5 years, 11 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
« no previous file with comments | « no previous file | tools/perf/measurements/smoothness_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import sys 4 import sys
5 5
6 from measurements import smooth_gesture_util 6 from measurements import smooth_gesture_util
7 from telemetry.core.platform import tracing_category_filter 7 from telemetry.core.platform import tracing_category_filter
8 from telemetry.core.platform import tracing_options 8 from telemetry.core.platform import tracing_options
9 from telemetry.timeline import trace_data as trace_data_module 9 from telemetry.timeline import trace_data as trace_data_module
10 from telemetry.timeline.model import TimelineModel 10 from telemetry.timeline.model import TimelineModel
(...skipping 19 matching lines...) Expand all
30 def SetUp(self, page, tab): 30 def SetUp(self, page, tab):
31 # FIXME: Remove webkit.console when blink.console lands in chromium and 31 # FIXME: Remove webkit.console when blink.console lands in chromium and
32 # the ref builds are updated. crbug.com/386847 32 # the ref builds are updated. crbug.com/386847
33 custom_categories = ['webkit.console', 'blink.console', 'benchmark'] 33 custom_categories = ['webkit.console', 'blink.console', 'benchmark']
34 custom_categories += page.GetSyntheticDelayCategories() 34 custom_categories += page.GetSyntheticDelayCategories()
35 category_filter = tracing_category_filter.TracingCategoryFilter() 35 category_filter = tracing_category_filter.TracingCategoryFilter()
36 for c in custom_categories: 36 for c in custom_categories:
37 category_filter.AddIncludedCategory(c) 37 category_filter.AddIncludedCategory(c)
38 options = tracing_options.TracingOptions() 38 options = tracing_options.TracingOptions()
39 options.enable_chrome_trace = True 39 options.enable_chrome_trace = True
40 if tab.browser.platform.tracing_controller.IsDisplayTracingSupported(): 40 options.enable_platform_display_trace = True
41 options.enable_platform_display_trace = True
42 tab.browser.platform.tracing_controller.Start(options, category_filter, 60) 41 tab.browser.platform.tracing_controller.Start(options, category_filter, 60)
43 42
44 def Start(self, tab): 43 def Start(self, tab):
45 # Start the smooth marker for all smooth actions. 44 # Start the smooth marker for all smooth actions.
46 runner = action_runner.ActionRunner(tab) 45 runner = action_runner.ActionRunner(tab)
47 self._interaction = runner.BeginInteraction( 46 self._interaction = runner.BeginInteraction(
48 RUN_SMOOTH_ACTIONS, is_smooth=True) 47 RUN_SMOOTH_ACTIONS, is_smooth=True)
49 48
50 def Stop(self, tab): 49 def Stop(self, tab):
51 # End the smooth marker for all smooth actions. 50 # End the smooth marker for all smooth actions.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 # Create an interaction_record for this legacy measurement. Since we don't 93 # Create an interaction_record for this legacy measurement. Since we don't
95 # wrap the results that are sent to smoothness metric, the label will 94 # wrap the results that are sent to smoothness metric, the label will
96 # not be used. 95 # not be used.
97 smoothness_metric = smoothness.SmoothnessMetric() 96 smoothness_metric = smoothness.SmoothnessMetric()
98 smoothness_metric.AddResults( 97 smoothness_metric.AddResults(
99 self._timeline_model, renderer_thread, smooth_records, results) 98 self._timeline_model, renderer_thread, smooth_records, results)
100 99
101 def CleanUp(self, tab): 100 def CleanUp(self, tab):
102 if tab.browser.platform.tracing_controller.is_tracing_running: 101 if tab.browser.platform.tracing_controller.is_tracing_running:
103 tab.browser.platform.tracing_controller.Stop() 102 tab.browser.platform.tracing_controller.Stop()
OLDNEW
« no previous file with comments | « no previous file | tools/perf/measurements/smoothness_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698