| 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.web_perf import timeline_based_measurement | 7 from telemetry.web_perf import timeline_based_measurement |
| 7 import page_sets | 8 import page_sets |
| 8 from telemetry import benchmark | 9 from telemetry import benchmark |
| 9 | 10 |
| 10 | 11 |
| 11 # 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 |
| 12 # are the primary means of benchmarking power. | 13 # are the primary means of benchmarking power. |
| 13 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): | 14 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): |
| 14 | 15 |
| 15 def CreateTimelineBasedMeasurementOptions(self): | 16 def CreateTimelineBasedMeasurementOptions(self): |
| 16 options = timeline_based_measurement.Options() | 17 options = timeline_based_measurement.Options( |
| 18 chrome_trace_category_filter.ChromeTraceCategoryFilter()) |
| 19 options.config.chrome_trace_config.category_filter.AddFilterString('rail') |
| 17 options.config.enable_battor_trace = True | 20 options.config.enable_battor_trace = True |
| 18 options.config.enable_chrome_trace = True | 21 options.config.enable_chrome_trace = True |
| 19 options.config.enable_atrace_trace = True | 22 options.config.enable_atrace_trace = True |
| 20 options.config.atrace_config.categories = ['sched'] | 23 options.config.atrace_config.categories = ['sched'] |
| 21 options.config.enable_cpu_trace = True | 24 options.config.enable_cpu_trace = True |
| 22 options.config.chrome_trace_config.SetDefaultOverheadFilter() | |
| 23 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 25 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
| 24 return options | 26 return options |
| 25 | 27 |
| 26 @classmethod | 28 @classmethod |
| 27 def ShouldDisable(cls, possible_browser): | 29 def ShouldDisable(cls, possible_browser): |
| 28 # Only run if BattOr is detected. | 30 # Only run if BattOr is detected. |
| 29 if not possible_browser.platform.HasBattOrConnected(): | 31 if not possible_browser.platform.HasBattOrConnected(): |
| 30 return True | 32 return True |
| 31 | 33 |
| 32 # Galaxy S5s have problems with running system health metrics. | 34 # Galaxy S5s have problems with running system health metrics. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 options = timeline_based_measurement.Options() | 111 options = timeline_based_measurement.Options() |
| 110 options.config.enable_battor_trace = True | 112 options.config.enable_battor_trace = True |
| 111 options.config.enable_chrome_trace = False | 113 options.config.enable_chrome_trace = False |
| 112 options.config.chrome_trace_config.SetDefaultOverheadFilter() | 114 options.config.chrome_trace_config.SetDefaultOverheadFilter() |
| 113 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 115 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
| 114 return options | 116 return options |
| 115 | 117 |
| 116 @classmethod | 118 @classmethod |
| 117 def Name(cls): | 119 def Name(cls): |
| 118 return 'battor.power_cases_no_chrome_trace' | 120 return 'battor.power_cases_no_chrome_trace' |
| OLD | NEW |