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

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

Issue 1140353003: [Telemetry] Disable auto issuing record for thread_times (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix blink_style & key_idle_power_cases Created 5 years, 7 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_unittest.py ('k') | tools/perf/page_sets/key_idle_power_cases.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 2306c93a2872501eff531b996c4e23960796bdbd..608a17a468786564f0b2f2c6fb0d180de4d4b8b4 100644
--- a/tools/perf/measurements/timeline_controller.py
+++ b/tools/perf/measurements/timeline_controller.py
@@ -5,6 +5,7 @@
from telemetry.core.platform import tracing_category_filter
from telemetry.core.platform import tracing_options
from telemetry.page import action_runner
+from telemetry.page import page_test
from telemetry.timeline.model import TimelineModel
from telemetry.value import trace
from telemetry.web_perf import smooth_gesture_util
@@ -15,13 +16,14 @@ RUN_SMOOTH_ACTIONS = 'RunSmoothAllActions'
class TimelineController(object):
- def __init__(self):
+ def __init__(self, enable_auto_issuing_record=True):
super(TimelineController, self).__init__()
self.trace_categories = None
self._model = None
self._renderer_process = None
self._smooth_records = []
self._interaction = None
+ self._enable_auto_issuing_record = enable_auto_issuing_record
def SetUp(self, page, tab):
"""Starts gathering timeline data.
@@ -43,13 +45,15 @@ class TimelineController(object):
def Start(self, tab):
# Start the smooth marker for all actions.
runner = action_runner.ActionRunner(tab)
- self._interaction = runner.CreateInteraction(
- RUN_SMOOTH_ACTIONS)
- self._interaction.Begin()
+ if self._enable_auto_issuing_record:
+ self._interaction = runner.CreateInteraction(
+ RUN_SMOOTH_ACTIONS)
+ self._interaction.Begin()
def Stop(self, tab, results):
# End the smooth marker for all actions.
- self._interaction.End()
+ if self._enable_auto_issuing_record:
+ self._interaction.End()
# Stop tracing.
timeline_data = tab.browser.platform.tracing_controller.Stop()
results.AddValue(trace.TraceValue(
@@ -81,6 +85,9 @@ class TimelineController(object):
if len(self._smooth_records) == 0 and run_smooth_actions_record:
self._smooth_records = [run_smooth_actions_record]
+ if len(self._smooth_records) == 0:
+ raise page_test.Failure('No interaction record was created.')
+
def CleanUp(self, tab):
if tab.browser.platform.tracing_controller.is_tracing_running:
« no previous file with comments | « tools/perf/measurements/thread_times_unittest.py ('k') | tools/perf/page_sets/key_idle_power_cases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698