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 | |
5 from core import perf_benchmark | 7 from core import perf_benchmark |
6 from telemetry.web_perf import timeline_based_measurement | 8 from telemetry.web_perf import timeline_based_measurement |
7 import page_sets | 9 import page_sets |
8 from telemetry import benchmark | 10 from telemetry import benchmark |
9 | 11 |
10 | 12 |
11 # TODO(rnephew): Remove BattOr naming from all benchmarks once the BattOr tests | 13 # TODO(rnephew): Remove BattOr naming from all benchmarks once the BattOr tests |
12 # are the primary means of benchmarking power. | 14 # are the primary means of benchmarking power. |
13 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): | 15 class _BattOrBenchmark(perf_benchmark.PerfBenchmark): |
14 | 16 |
15 def CreateTimelineBasedMeasurementOptions(self): | 17 def CreateTimelineBasedMeasurementOptions(self): |
16 options = timeline_based_measurement.Options() | 18 options = timeline_based_measurement.Options() |
17 options.config.enable_battor_trace = True | 19 options.config.enable_battor_trace = True |
18 options.config.enable_chrome_trace = True | 20 options.config.enable_chrome_trace = True |
19 options.config.chrome_trace_config.SetDefaultOverheadFilter() | 21 options.config.chrome_trace_config.SetDefaultOverheadFilter() |
20 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 22 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
21 return options | 23 return options |
22 | 24 |
23 @classmethod | 25 @classmethod |
24 def ShouldDisable(cls, possible_browser): | 26 def ShouldDisable(cls, possible_browser): |
25 # Only run if BattOr is detected. | 27 # Only run if BattOr is detected. |
26 if not possible_browser.platform.HasBattOrConnected(): | 28 if not possible_browser.platform.HasBattOrConnected(): |
27 return True | 29 return True |
28 | 30 |
29 # Galaxy S5s have problems with running system health metrics. | 31 # Galaxy S5s have problems with running system health metrics. |
30 # http://crbug.com/600463 | 32 # http://crbug.com/600463 |
31 galaxy_s5_type_name = 'SM-G900H' | 33 galaxy_s5_type_name = 'SM-G900H' |
32 return possible_browser.platform.GetDeviceTypeName() == galaxy_s5_type_name | 34 if possible_browser.platform.GetDeviceTypeName() == galaxy_s5_type_name: |
35 return True | |
36 | |
37 # TODO(charliea): The BattOr agent is failing intermittently on Mac. We | |
38 # still want it running on the FYI waterfall to track the flakiness, but | |
39 # want it disabled on the main perf waterfall until we can make things | |
40 # stable. http://crbug.com/634188 | |
aiolos (Not reviewing)
2016/08/16 21:47:46
Nit: The bug url should be on it's own line.
| |
41 return (possible_browser.platform.GetOSName() == 'mac' and | |
42 'BUILDBOT_MASTERNAME' in os.environ and | |
43 os.environ['BUILDBOT_MASTERNAME'] == 'chromium.perf') | |
33 | 44 |
34 @classmethod | 45 @classmethod |
35 def ShouldTearDownStateAfterEachStoryRun(cls): | 46 def ShouldTearDownStateAfterEachStoryRun(cls): |
36 return True | 47 return True |
37 | 48 |
38 | 49 |
39 # android: See battor.android.tough_video_cases below | 50 # android: See battor.android.tough_video_cases below |
40 # win8: crbug.com/531618 | 51 # win8: crbug.com/531618 |
41 # crbug.com/565180: Only include cases that report time_to_play | 52 # crbug.com/565180: Only include cases that report time_to_play |
42 # Taken directly from media benchmark. | 53 # Taken directly from media benchmark. |
43 @benchmark.Disabled('android', 'win8') | 54 @benchmark.Disabled('android', 'win8') |
44 class BattOrToughVideoCases(_BattOrBenchmark): | 55 class BattOrToughVideoCases(_BattOrBenchmark): |
45 """Obtains media metrics for key user scenarios.""" | 56 """Obtains media metrics for key user scenarios.""" |
46 page_set = page_sets.ToughVideoCasesPageSet | 57 page_set = page_sets.ToughVideoCasesPageSet |
47 | 58 |
48 @classmethod | 59 @classmethod |
49 def Name(cls): | 60 def Name(cls): |
50 return 'battor.tough_video_cases' | 61 return 'battor.tough_video_cases' |
51 | 62 |
52 | 63 |
53 # TODO(rnephew): Add a version that scrolls. | 64 # TODO(rnephew): Add a version that scrolls. |
54 class BattOrSystemHealthLoadingDesktop(_BattOrBenchmark): | 65 class BattOrSystemHealthLoadingDesktop(_BattOrBenchmark): |
55 """Desktop Chrome Memory System Health Benchmark.""" | 66 """Desktop Chrome Memory System Health Benchmark.""" |
56 | 67 |
57 def CreateStorySet(self, options): | 68 def CreateStorySet(self, options): |
58 return page_sets.SystemHealthStorySet(platform='desktop', case='load') | 69 return page_sets.SystemHealthStorySet(platform='desktop', case='load') |
59 | 70 |
60 @classmethod | 71 @classmethod |
61 def ShouldDisable(cls, possible_browser): | 72 def ShouldDisable(cls, possible_browser): |
62 return (possible_browser.platform.GetDeviceTypeName() != 'Desktop' or | 73 return ( |
63 not possible_browser.platform.HasBattOrConnected()) | 74 super(BattOrSystemHealthLoadingDesktop, cls).ShouldDisable( |
75 possible_browser) or | |
76 possible_browser.platform.GetDeviceTypeName() != 'Desktop') | |
64 | 77 |
65 @classmethod | 78 @classmethod |
66 def Name(cls): | 79 def Name(cls): |
67 return 'battor.system_health_loading_desktop' | 80 return 'battor.system_health_loading_desktop' |
68 | 81 |
69 | 82 |
70 class BattOrSystemHealthLoadingMobile(_BattOrBenchmark): | 83 class BattOrSystemHealthLoadingMobile(_BattOrBenchmark): |
71 """Mobile Chrome Memory System Health Benchmark.""" | 84 """Mobile Chrome Memory System Health Benchmark.""" |
72 | 85 |
73 def CreateStorySet(self, options): | 86 def CreateStorySet(self, options): |
74 return page_sets.SystemHealthStorySet(platform='mobile', case='load') | 87 return page_sets.SystemHealthStorySet(platform='mobile', case='load') |
75 | 88 |
76 @classmethod | 89 @classmethod |
77 def ShouldDisable(cls, possible_browser): | 90 def ShouldDisable(cls, possible_browser): |
78 if possible_browser.platform.GetDeviceTypeName() == 'Desktop': | 91 if possible_browser.platform.GetDeviceTypeName() == 'Desktop': |
79 return True | 92 return True |
80 if (possible_browser.browser_type == 'reference' and | 93 if (possible_browser.browser_type == 'reference' and |
81 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): | 94 possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): |
82 return True | 95 return True |
83 return not possible_browser.platform.HasBattOrConnected() | 96 |
97 return super(BattOrSystemHealthLoadingMobile, cls).ShouldDisable( | |
98 possible_browser) | |
84 | 99 |
85 @classmethod | 100 @classmethod |
86 def Name(cls): | 101 def Name(cls): |
87 return 'battor.system_health_loading_mobile' | 102 return 'battor.system_health_loading_mobile' |
88 | 103 |
89 | 104 |
90 class BattOrPowerCases(_BattOrBenchmark): | 105 class BattOrPowerCases(_BattOrBenchmark): |
91 page_set = page_sets.power_cases.PowerCasesPageSet | 106 page_set = page_sets.power_cases.PowerCasesPageSet |
92 | 107 |
93 @classmethod | 108 @classmethod |
94 def Name(cls): | 109 def Name(cls): |
95 return 'battor.power_cases' | 110 return 'battor.power_cases' |
96 | 111 |
97 | 112 |
98 class BattOrPowerCasesNoChromeTrace(_BattOrBenchmark): | 113 class BattOrPowerCasesNoChromeTrace(_BattOrBenchmark): |
99 page_set = page_sets.power_cases.PowerCasesPageSet | 114 page_set = page_sets.power_cases.PowerCasesPageSet |
100 | 115 |
101 def CreateTimelineBasedMeasurementOptions(self): | 116 def CreateTimelineBasedMeasurementOptions(self): |
102 options = timeline_based_measurement.Options() | 117 options = timeline_based_measurement.Options() |
103 options.config.enable_battor_trace = True | 118 options.config.enable_battor_trace = True |
104 options.config.enable_chrome_trace = False | 119 options.config.enable_chrome_trace = False |
105 options.config.chrome_trace_config.SetDefaultOverheadFilter() | 120 options.config.chrome_trace_config.SetDefaultOverheadFilter() |
106 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) | 121 options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
107 return options | 122 return options |
108 | 123 |
109 @classmethod | 124 @classmethod |
110 def Name(cls): | 125 def Name(cls): |
111 return 'battor.power_cases_no_chrome_trace' | 126 return 'battor.power_cases_no_chrome_trace' |
OLD | NEW |