| 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 import os | |
| 6 | |
| 7 from core import perf_benchmark | 5 from core import perf_benchmark |
| 8 from telemetry.timeline import chrome_trace_category_filter | 6 from telemetry.timeline import chrome_trace_category_filter |
| 9 from telemetry.web_perf import timeline_based_measurement | 7 from telemetry.web_perf import timeline_based_measurement |
| 10 import page_sets | 8 import page_sets |
| 11 from telemetry import benchmark | 9 from telemetry import benchmark |
| 12 | 10 |
| 13 | 11 |
| 14 # 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 |
| 15 # are the primary means of benchmarking power. | 13 # are the primary means of benchmarking power. |
| 16 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): | 14 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): |
| 17 | 15 |
| 18 def CreateTimelineBasedMeasurementOptions(self): | 16 def CreateTimelineBasedMeasurementOptions(self): |
| 19 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( | 17 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( |
| 20 filter_string='toplevel') | 18 filter_string='toplevel') |
| 21 options = timeline_based_measurement.Options(category_filter) | 19 options = timeline_based_measurement.Options(category_filter) |
| 22 options.config.chrome_trace_config.category_filter.AddFilterString('rail') | 20 options.config.chrome_trace_config.category_filter.AddFilterString('rail') |
| 23 # TODO(charliea): Reenable the CPU tracing agent once it no longer causes | 21 # TODO(charliea): Reenable the CPU tracing agent once it no longer causes |
| 24 # indefinite hangs on Windows. | 22 # indefinite hangs on Windows. |
| 25 # https://crbug.com/647443 | 23 # https://crbug.com/647443 |
| 26 # TODO(charliea): Reenable BattOr tracing on the main perf waterfall once | 24 options.config.enable_battor_trace = True |
| 27 # the BattOrs stop crashing as their SD cards fill up. | |
| 28 # crbug.com/652384 | |
| 29 options.config.enable_battor_trace = ( | |
| 30 os.environ.get('BUILDBOT_MASTERNAME') == 'chromium.perf.fyi') | |
| 31 options.config.enable_chrome_trace = True | 25 options.config.enable_chrome_trace = True |
| 32 options.config.enable_atrace_trace = True | 26 options.config.enable_atrace_trace = True |
| 33 options.config.atrace_config.categories = ['sched'] | 27 options.config.atrace_config.categories = ['sched'] |
| 34 options.SetTimelineBasedMetrics( | 28 options.SetTimelineBasedMetrics( |
| 35 ['powerMetric', 'clockSyncLatencyMetric', 'cpuTimeMetric']) | 29 ['powerMetric', 'clockSyncLatencyMetric', 'cpuTimeMetric']) |
| 36 return options | 30 return options |
| 37 | 31 |
| 38 @classmethod | 32 @classmethod |
| 39 def ShouldDisable(cls, possible_browser): | 33 def ShouldDisable(cls, possible_browser): |
| 40 # Only run if BattOr is detected. | 34 # Only run if BattOr is detected. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 def Name(cls): | 66 def Name(cls): |
| 73 return 'battor.power_cases' | 67 return 'battor.power_cases' |
| 74 | 68 |
| 75 | 69 |
| 76 @benchmark.Disabled('all') # crbug.com/651384. | 70 @benchmark.Disabled('all') # crbug.com/651384. |
| 77 class BattOrPowerCasesNoChromeTrace(_BattOrBenchmark): | 71 class BattOrPowerCasesNoChromeTrace(_BattOrBenchmark): |
| 78 page_set = page_sets.power_cases.PowerCasesPageSet | 72 page_set = page_sets.power_cases.PowerCasesPageSet |
| 79 | 73 |
| 80 def CreateTimelineBasedMeasurementOptions(self): | 74 def CreateTimelineBasedMeasurementOptions(self): |
| 81 options = timeline_based_measurement.Options() | 75 options = timeline_based_measurement.Options() |
| 82 # TODO(charliea): Reenable BattOr tracing on the main perf waterfall once | 76 options.config.enable_battor_trace = True |
| 83 # the BattOrs stop crashing as their SD cards fill up. | |
| 84 # crbug.com/652384 | |
| 85 options.config.enable_battor_trace = ( | |
| 86 os.environ.get('BUILDBOT_MASTERNAME') == 'chromium.perf.fyi') | |
| 87 options.config.enable_chrome_trace = False | 77 options.config.enable_chrome_trace = False |
| 88 options.config.chrome_trace_config.SetDefaultOverheadFilter() | 78 options.config.chrome_trace_config.SetDefaultOverheadFilter() |
| 89 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 79 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
| 90 return options | 80 return options |
| 91 | 81 |
| 92 @classmethod | 82 @classmethod |
| 93 def Name(cls): | 83 def Name(cls): |
| 94 return 'battor.power_cases_no_chrome_trace' | 84 return 'battor.power_cases_no_chrome_trace' |
| 95 | 85 |
| 96 | 86 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 108 @benchmark.Enabled('mac') | 98 @benchmark.Enabled('mac') |
| 109 class BattOrSteadyStatePages(_BattOrBenchmark): | 99 class BattOrSteadyStatePages(_BattOrBenchmark): |
| 110 | 100 |
| 111 def CreateStorySet(self, options): | 101 def CreateStorySet(self, options): |
| 112 # We want it to wait for 30 seconds to be comparable to legacy power tests. | 102 # We want it to wait for 30 seconds to be comparable to legacy power tests. |
| 113 return page_sets.IdleAfterLoadingStories(wait_in_seconds=30) | 103 return page_sets.IdleAfterLoadingStories(wait_in_seconds=30) |
| 114 | 104 |
| 115 @classmethod | 105 @classmethod |
| 116 def Name(cls): | 106 def Name(cls): |
| 117 return 'battor.steady_state' | 107 return 'battor.steady_state' |
| OLD | NEW |