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

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

Issue 199733007: Remove start & stop logic from timeline_metric. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/measurements/loading_trace.py ('k') | tools/perf/measurements/timeline_based_measurement.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/thread_times.py
diff --git a/tools/perf/measurements/thread_times.py b/tools/perf/measurements/thread_times.py
index 13a90757c7cd2aec9cff2669aeb370584a03afca..961fef645184f081cfda1444f27fe9f496616b9c 100644
--- a/tools/perf/measurements/thread_times.py
+++ b/tools/perf/measurements/thread_times.py
@@ -1,14 +1,14 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-
+from measurements import timeline_controller
from metrics import timeline
from telemetry.page import page_measurement
class ThreadTimes(page_measurement.PageMeasurement):
def __init__(self):
super(ThreadTimes, self).__init__('RunSmoothness')
- self._metric = None
+ self._timeline_controller = None
@classmethod
def AddCommandLineArgs(cls, parser):
@@ -22,18 +22,29 @@ class ThreadTimes(page_measurement.PageMeasurement):
return False
def WillRunActions(self, page, tab):
- self._metric = timeline.ThreadTimesTimelineMetric()
- if self.options.report_silk_results:
- self._metric.results_to_report = timeline.ReportSilkResults
+ self._timeline_controller = timeline_controller.TimelineController()
if self.options.report_silk_details:
- self._metric.details_to_report = timeline.ReportSilkDetails
- self._metric.Start(page, tab)
+ # We need the other traces in order to have any details to report.
+ self.timeline_controller.trace_categories = \
+ timeline_controller.DEFAULT_TRACE_CATEGORIES
+ else:
+ self._timeline_controller.trace_categories = \
+ timeline_controller.MINIMAL_TRACE_CATEGORIES
+ self._timeline_controller.Start(page, tab)
def DidRunAction(self, page, tab, action):
- self._metric.AddActionToIncludeInMetric(action)
+ self._timeline_controller.AddActionToIncludeInMetric(action)
def DidRunActions(self, page, tab):
- self._metric.Stop(page, tab)
+ self._timeline_controller.Stop(tab)
def MeasurePage(self, page, tab, results):
- self._metric.AddResults(tab, results)
+ metric = timeline.ThreadTimesTimelineMetric(
+ self._timeline_controller.model,
+ self._timeline_controller.renderer_process,
+ self._timeline_controller.action_ranges)
+ if self.options.report_silk_results:
+ metric.results_to_report = timeline.ReportSilkResults
+ if self.options.report_silk_details:
+ metric.details_to_report = timeline.ReportSilkDetails
+ metric.AddResults(tab, results)
« no previous file with comments | « tools/perf/measurements/loading_trace.py ('k') | tools/perf/measurements/timeline_based_measurement.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698