Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 core import perf_benchmark | 5 from core import perf_benchmark |
| 6 from telemetry.timeline import chrome_trace_category_filter | 6 from telemetry.timeline import chrome_trace_category_filter |
| 7 from telemetry.web_perf import timeline_based_measurement | 7 from telemetry.web_perf import timeline_based_measurement |
| 8 import page_sets | 8 import page_sets |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 | 10 |
| 11 | 11 |
| 12 # TODO(rnephew): Remove BattOr naming from all benchmarks once the BattOr tests | 12 # TODO(rnephew): Remove BattOr naming from all benchmarks once the BattOr tests |
| 13 # are the primary means of benchmarking power. | 13 # are the primary means of benchmarking power. |
| 14 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): | 14 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): |
| 15 | 15 |
| 16 def CreateTimelineBasedMeasurementOptions(self): | 16 def CreateTimelineBasedMeasurementOptions(self): |
| 17 options = timeline_based_measurement.Options( | 17 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 18 chrome_trace_category_filter.ChromeTraceCategoryFilter()) | 18 filter_string='toplevel') |
| 19 options = timeline_based_measurement.Options(category_filter) | |
| 19 options.config.chrome_trace_config.category_filter.AddFilterString('rail') | 20 options.config.chrome_trace_config.category_filter.AddFilterString('rail') |
| 20 options.config.enable_battor_trace = True | 21 options.config.enable_battor_trace = True |
| 21 options.config.enable_chrome_trace = True | 22 options.config.enable_chrome_trace = True |
| 22 options.config.enable_atrace_trace = True | 23 options.config.enable_atrace_trace = True |
| 23 options.config.atrace_config.categories = ['sched'] | 24 options.config.atrace_config.categories = ['sched'] |
| 24 options.config.enable_cpu_trace = True | 25 options.config.enable_cpu_trace = True |
| 25 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 26 options.SetTimelineBasedMetrics( |
| 27 ['powerMetric', 'clockSyncLatencyMetric', 'cpuTimeMetric']) | |
| 26 return options | 28 return options |
| 27 | 29 |
| 28 @classmethod | 30 @classmethod |
| 29 def ShouldDisable(cls, possible_browser): | 31 def ShouldDisable(cls, possible_browser): |
| 30 # Only run if BattOr is detected. | 32 # Only run if BattOr is detected. |
| 31 if not possible_browser.platform.HasBattOrConnected(): | 33 if not possible_browser.platform.HasBattOrConnected(): |
| 32 return True | 34 return True |
| 33 | 35 |
| 34 # Galaxy S5s have problems with running system health metrics. | 36 # Galaxy S5s have problems with running system health metrics. |
| 35 # http://crbug.com/600463 | 37 # http://crbug.com/600463 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 return page_sets.MacGpuTrivialPagesStorySet(wait_in_seconds=30) | 130 return page_sets.MacGpuTrivialPagesStorySet(wait_in_seconds=30) |
| 129 | 131 |
| 130 @classmethod | 132 @classmethod |
| 131 def Name(cls): | 133 def Name(cls): |
| 132 return 'battor.trivial_pages' | 134 return 'battor.trivial_pages' |
| 133 | 135 |
| 134 @benchmark.Enabled('mac') | 136 @benchmark.Enabled('mac') |
| 135 class BattOrSteadyStatePages(_BattOrBenchmark): | 137 class BattOrSteadyStatePages(_BattOrBenchmark): |
| 136 | 138 |
| 137 def CreateStorySet(self, options): | 139 def CreateStorySet(self, options): |
| 138 # We want it to wait for 30 seconds to be comparable to legacy power tests. | 140 # We want it to wait for 30 seconds to be comparable to legacy power tests, |
| 141 # but that produces too much tracing data. Instead wait for 15 seconds. | |
|
charliea (OOO until 10-5)
2016/09/19 17:09:50
nit: please eliminate the second line now that we
erikchen
2016/09/19 17:19:38
Done.
| |
| 139 return page_sets.IdleAfterLoadingStories(wait_in_seconds=30) | 142 return page_sets.IdleAfterLoadingStories(wait_in_seconds=30) |
| 140 | 143 |
| 141 @classmethod | 144 @classmethod |
| 142 def Name(cls): | 145 def Name(cls): |
| 143 return 'battor.steady_state' | 146 return 'battor.steady_state' |
| OLD | NEW |