OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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.core.platform import tracing_options | 6 from telemetry.core.platform import tracing_options |
7 from telemetry.page import page_test | 7 from telemetry.page import page_test |
8 from telemetry.timeline import model | 8 from telemetry.timeline import model |
9 from telemetry.value import scalar | 9 from telemetry.value import scalar |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 timeline_model, | 44 timeline_model, |
45 "LayerTreeHostCommon::CalculateDrawProperties"); | 45 "LayerTreeHostCommon::CalculateDrawProperties"); |
46 | 46 |
47 (pt_avg, pt_sum) = self.ComputeAverageAndSumOfDurations( | 47 (pt_avg, pt_sum) = self.ComputeAverageAndSumOfDurations( |
48 timeline_model, | 48 timeline_model, |
49 "LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees"); | 49 "LayerTreeHostCommon::ComputeVisibleRectsWithPropertyTrees"); |
50 | 50 |
51 reduction = 100.0 * (1.0 - (pt_sum / cdp_sum)) | 51 reduction = 100.0 * (1.0 - (pt_sum / cdp_sum)) |
52 | 52 |
53 results.AddValue(scalar.ScalarValue( | 53 results.AddValue(scalar.ScalarValue( |
54 results.current_page, 'CDP_reduction', ' %', reduction, | 54 results.current_page, 'CDP_reduction', 'reduction%', reduction, |
55 description='Reduction in CDP cost with property trees')) | 55 description='Reduction in CDP cost with property trees')) |
56 | 56 |
57 results.AddValue(scalar.ScalarValue( | 57 results.AddValue(scalar.ScalarValue( |
58 results.current_page, 'CDP_avg_cost', 'ms', cdp_avg, | 58 results.current_page, 'CDP_avg_cost', 'ms', cdp_avg, |
59 description='Average time spent in CDP')) | 59 description='Average time spent in CDP')) |
60 | 60 |
61 results.AddValue(scalar.ScalarValue( | 61 results.AddValue(scalar.ScalarValue( |
62 results.current_page, 'PT_avg_cost', 'ms', pt_avg, | 62 results.current_page, 'PT_avg_cost', 'ms', pt_avg, |
63 description='Average time spent processing property trees')) | 63 description='Average time spent processing property trees')) |
64 | 64 |
65 def CleanUpAfterPage(self, page, tab): | 65 def CleanUpAfterPage(self, page, tab): |
66 tracing_controller = tab.browser.platform.tracing_controller | 66 tracing_controller = tab.browser.platform.tracing_controller |
67 if tracing_controller.is_tracing_running: | 67 if tracing_controller.is_tracing_running: |
68 tracing_controller.Stop() | 68 tracing_controller.Stop() |
OLD | NEW |