Chromium Code Reviews| Index: tools/perf/benchmarks/system_health.py |
| diff --git a/tools/perf/benchmarks/system_health.py b/tools/perf/benchmarks/system_health.py |
| index 2d80785a99da3ac35da7d034cc2eb86f70e8efc2..7a0af423bc0f80559e78377f9fb9c27e89fdf143 100644 |
| --- a/tools/perf/benchmarks/system_health.py |
| +++ b/tools/perf/benchmarks/system_health.py |
| @@ -56,6 +56,38 @@ class _MemorySystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| return not _IGNORED_STATS_RE.search(value.name) |
| +class _PowerSystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
|
petrcermak
2016/08/12 09:03:00
Instead of interleaving the classes:
_MemorySyste
charliea (OOO until 10-5)
2016/08/12 14:18:43
Done.
|
| + """Chrome Power System Health Benchmark. |
| + |
| + https://goo.gl/Jek2NL. |
| + """ |
| + |
| + def CreateTimelineBasedMeasurementOptions(self): |
| + options = timeline_based_measurement.Options() |
| + options.config.enable_battor_trace = True |
| + options.config.enable_chrome_trace = True |
| + options.config.chrome_trace_config.SetDefaultOverheadFilter() |
| + options.SetTimelineBasedMetrics(['powerMetric', 'clockSyncLatencyMetric']) |
| + return options |
| + |
| + def CreateStorySet(self, options): |
| + return page_sets.SystemHealthStorySet(platform=self.PLATFORM) |
| + |
| + @classmethod |
| + def ShouldTearDownStateAfterEachStoryRun(cls): |
| + return True |
| + |
| + @classmethod |
| + def Name(cls): |
| + return 'system_health.power_%s' % cls.PLATFORM |
| + |
| + @classmethod |
| + def ValueCanBeAddedPredicate(cls, value, is_first_result): |
| + # TODO(crbug.com/610962): Remove this stopgap when the perf dashboard |
| + # is able to cope with the data load generated by TBMv2 metrics. |
| + return not _IGNORED_STATS_RE.search(value.name) |
|
petrcermak
2016/08/12 09:03:00
How many values does your metric generate? If it's
charliea (OOO until 10-5)
2016/08/12 14:18:43
Done.
|
| + |
| + |
| class DesktopMemorySystemHealth(_MemorySystemHealthBenchmark): |
| """Desktop Chrome Memory System Health Benchmark.""" |
| PLATFORM = 'desktop' |
| @@ -81,6 +113,33 @@ class MobileMemorySystemHealth(_MemorySystemHealthBenchmark): |
| return possible_browser.platform.GetDeviceTypeName() == 'Desktop' |
| +class DesktopPowerSystemHealth(_PowerSystemHealthBenchmark): |
| + """Desktop Chrome Energy System Health Benchmark.""" |
| + PLATFORM = 'desktop' |
| + |
| + @classmethod |
| + def ShouldDisable(cls, possible_browser): |
| + # http://crbug.com/624355 (reference builds). |
| + return (possible_browser.platform.GetDeviceTypeName() != 'Desktop' or |
| + possible_browser.browser_type == 'reference' or |
| + not possible_browser.platform.HasBattOrConnected()) |
| + |
| + |
| +class MobilePowerSystemHealth(_PowerSystemHealthBenchmark): |
| + """Mobile Chrome Energy System Health Benchmark.""" |
| + PLATFORM = 'mobile' |
| + |
| + @classmethod |
| + def ShouldDisable(cls, possible_browser): |
| + # http://crbug.com/612144 |
| + if (possible_browser.browser_type == 'reference' and |
| + possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'): |
| + return True |
| + |
| + return (possible_browser.platform.GetDeviceTypeName() == 'Desktop' or |
| + not possible_browser.platform.HasBattOrConnected()) |
| + |
| + |
| @benchmark.Enabled('android-webview') |
| class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark): |
| """Webview startup time benchmark |