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 | 4 |
5 from telemetry.core.platform import tracing_category_filter | 5 from telemetry.core.platform import tracing_category_filter |
6 from telemetry.page import page_test | 6 from telemetry.page import page_test |
7 from telemetry.web_perf.metrics import layout | 7 from telemetry.web_perf.metrics import layout |
8 | 8 |
9 from measurements import timeline_controller | 9 from measurements import timeline_controller |
10 from metrics import timeline | 10 from metrics import timeline |
11 | 11 |
12 | 12 |
13 class ThreadTimes(page_test.PageTest): | 13 class ThreadTimes(page_test.PageTest): |
14 def __init__(self, report_silk_details=False): | 14 def __init__(self, report_silk_details=False): |
15 super(ThreadTimes, self).__init__() | 15 super(ThreadTimes, self).__init__() |
16 self._timeline_controller = None | 16 self._timeline_controller = None |
17 self._report_silk_details = report_silk_details | 17 self._report_silk_details = report_silk_details |
18 | 18 |
19 def WillNavigateToPage(self, page, tab): | 19 def WillNavigateToPage(self, page, tab): |
20 self._timeline_controller = timeline_controller.TimelineController() | 20 self._timeline_controller = timeline_controller.TimelineController( |
| 21 enable_auto_issuing_record=False) |
21 if self._report_silk_details: | 22 if self._report_silk_details: |
22 # We need the other traces in order to have any details to report. | 23 # We need the other traces in order to have any details to report. |
23 self._timeline_controller.trace_categories = None | 24 self._timeline_controller.trace_categories = None |
24 else: | 25 else: |
25 self._timeline_controller.trace_categories = \ | 26 self._timeline_controller.trace_categories = \ |
26 tracing_category_filter.CreateNoOverheadFilter().filter_string | 27 tracing_category_filter.CreateNoOverheadFilter().filter_string |
27 self._timeline_controller.SetUp(page, tab) | 28 self._timeline_controller.SetUp(page, tab) |
28 | 29 |
29 def DidNavigateToPage(self, page, tab): | 30 def DidNavigateToPage(self, page, tab): |
30 self._timeline_controller.Start(tab) | 31 self._timeline_controller.Start(tab) |
31 | 32 |
32 def ValidateAndMeasurePage(self, page, tab, results): | 33 def ValidateAndMeasurePage(self, page, tab, results): |
33 self._timeline_controller.Stop(tab, results) | 34 self._timeline_controller.Stop(tab, results) |
34 metric = timeline.ThreadTimesTimelineMetric() | 35 metric = timeline.ThreadTimesTimelineMetric() |
35 renderer_thread = \ | 36 renderer_thread = \ |
36 self._timeline_controller.model.GetRendererThreadFromTabId(tab.id) | 37 self._timeline_controller.model.GetRendererThreadFromTabId(tab.id) |
37 if self._report_silk_details: | 38 if self._report_silk_details: |
38 metric.details_to_report = timeline.ReportSilkDetails | 39 metric.details_to_report = timeline.ReportSilkDetails |
39 metric.AddResults(self._timeline_controller.model, renderer_thread, | 40 metric.AddResults(self._timeline_controller.model, renderer_thread, |
40 self._timeline_controller.smooth_records, results) | 41 self._timeline_controller.smooth_records, results) |
41 layout_metric = layout.LayoutMetric() | 42 layout_metric = layout.LayoutMetric() |
42 layout_metric.AddResults(self._timeline_controller.model, renderer_thread, | 43 layout_metric.AddResults(self._timeline_controller.model, renderer_thread, |
43 self._timeline_controller.smooth_records, results) | 44 self._timeline_controller.smooth_records, results) |
44 | 45 |
45 def CleanUpAfterPage(self, _, tab): | 46 def CleanUpAfterPage(self, _, tab): |
46 if self._timeline_controller: | 47 if self._timeline_controller: |
47 self._timeline_controller.CleanUp(tab) | 48 self._timeline_controller.CleanUp(tab) |
OLD | NEW |