OLD | NEW |
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 from measurements import timeline_controller | 4 from measurements import timeline_controller |
5 from metrics import timeline | 5 from metrics import timeline |
6 from telemetry.core.backends.chrome import tracing_backend | 6 from telemetry.core.backends.chrome import tracing_backend |
7 from telemetry.page import page_measurement | 7 from telemetry.page import page_measurement |
8 | 8 |
9 class ThreadTimes(page_measurement.PageMeasurement): | 9 class ThreadTimes(page_measurement.PageMeasurement): |
10 def __init__(self): | 10 def __init__(self): |
(...skipping 21 matching lines...) Expand all Loading... |
32 self._timeline_controller.trace_categories = \ | 32 self._timeline_controller.trace_categories = \ |
33 tracing_backend.MINIMAL_TRACE_CATEGORIES | 33 tracing_backend.MINIMAL_TRACE_CATEGORIES |
34 self._timeline_controller.Start(page, tab) | 34 self._timeline_controller.Start(page, tab) |
35 | 35 |
36 def DidRunActions(self, page, tab): | 36 def DidRunActions(self, page, tab): |
37 self._timeline_controller.Stop(tab) | 37 self._timeline_controller.Stop(tab) |
38 | 38 |
39 def MeasurePage(self, page, tab, results): | 39 def MeasurePage(self, page, tab, results): |
40 metric = timeline.ThreadTimesTimelineMetric() | 40 metric = timeline.ThreadTimesTimelineMetric() |
41 renderer_thread = \ | 41 renderer_thread = \ |
42 self._timeline_controller.model.GetRendererThreadFromTab(tab) | 42 self._timeline_controller.model.GetRendererThreadFromTabId(tab.id) |
43 if self.options.report_silk_results: | 43 if self.options.report_silk_results: |
44 metric.results_to_report = timeline.ReportSilkResults | 44 metric.results_to_report = timeline.ReportSilkResults |
45 if self.options.report_silk_details: | 45 if self.options.report_silk_details: |
46 metric.details_to_report = timeline.ReportSilkDetails | 46 metric.details_to_report = timeline.ReportSilkDetails |
47 metric.AddResults(self._timeline_controller.model, renderer_thread, | 47 metric.AddResults(self._timeline_controller.model, renderer_thread, |
48 self._timeline_controller.smooth_records, results) | 48 self._timeline_controller.smooth_records, results) |
49 | 49 |
50 def CleanUpAfterPage(self, _, tab): | 50 def CleanUpAfterPage(self, _, tab): |
51 self._timeline_controller.CleanUp(tab) | 51 self._timeline_controller.CleanUp(tab) |
OLD | NEW |