OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 from benchmarks import silk_flags | 4 from benchmarks import silk_flags |
5 import page_sets | 5 import page_sets |
6 from telemetry import benchmark | 6 from telemetry import benchmark |
7 from telemetry.core.platform import tracing_category_filter | 7 from telemetry.core.platform import tracing_category_filter |
8 from telemetry.web_perf import timeline_based_measurement | 8 from telemetry.web_perf import timeline_based_measurement |
9 from telemetry.web_perf.metrics import gpu_timeline | 9 from telemetry.web_perf.metrics import gpu_timeline |
10 | 10 |
11 TOPLEVEL_GL_CATEGORY = 'gpu_toplevel' | 11 TOPLEVEL_GL_CATEGORY = 'gpu_toplevel' |
12 TOPLEVEL_CATEGORIES = ['disabled-by-default-gpu.device', | 12 TOPLEVEL_CATEGORIES = ['disabled-by-default-gpu.device', |
13 'disabled-by-default-gpu.service'] | 13 'disabled-by-default-gpu.service'] |
14 | 14 |
15 | 15 |
16 def _GetGPUTimelineMetric(_): | |
17 return [gpu_timeline.GPUTimelineMetric()] | |
18 | |
19 | |
20 class _GPUTimes(benchmark.Benchmark): | 16 class _GPUTimes(benchmark.Benchmark): |
21 def CreateTimelineBasedMeasurementOptions(self): | 17 def CreateTimelineBasedMeasurementOptions(self): |
22 cat_string = ','.join(TOPLEVEL_CATEGORIES) | 18 cat_string = ','.join(TOPLEVEL_CATEGORIES) |
23 cat_filter = tracing_category_filter.TracingCategoryFilter(cat_string) | 19 cat_filter = tracing_category_filter.TracingCategoryFilter(cat_string) |
24 | 20 |
25 return timeline_based_measurement.Options( | 21 return timeline_based_measurement.Options( |
26 overhead_level=cat_filter, | 22 overhead_level=cat_filter) |
27 get_metrics_from_flags_callback=_GetGPUTimelineMetric) | |
28 | 23 |
29 @classmethod | 24 @classmethod |
30 def ValueCanBeAddedPredicate(cls, value): | 25 def ValueCanBeAddedPredicate(cls, value): |
31 return (isinstance(value, gpu_timeline.GPUTimelineListOfValues) or | 26 return (isinstance(value, gpu_timeline.GPUTimelineListOfValues) or |
32 isinstance(value, gpu_timeline.GPUTimelineValue)) | 27 isinstance(value, gpu_timeline.GPUTimelineValue)) |
33 | 28 |
34 @benchmark.Disabled # http://crbug.com/455292 | 29 @benchmark.Disabled # http://crbug.com/455292 |
35 class GPUTimesKeyMobileSites(_GPUTimes): | 30 class GPUTimesKeyMobileSites(_GPUTimes): |
36 """Measures GPU timeline metric on key mobile sites.""" | 31 """Measures GPU timeline metric on key mobile sites.""" |
37 page_set = page_sets.KeyMobileSitesSmoothPageSet | 32 page_set = page_sets.KeyMobileSitesSmoothPageSet |
(...skipping 28 matching lines...) Expand all Loading... |
66 """Measures GPU timeline metric for the top 25 sites with GPU rasterization. | 61 """Measures GPU timeline metric for the top 25 sites with GPU rasterization. |
67 """ | 62 """ |
68 page_set = page_sets.Top25SmoothPageSet | 63 page_set = page_sets.Top25SmoothPageSet |
69 def CustomizeBrowserOptions(self, options): | 64 def CustomizeBrowserOptions(self, options): |
70 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) | 65 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) |
71 | 66 |
72 @classmethod | 67 @classmethod |
73 def Name(cls): | 68 def Name(cls): |
74 return 'gpu_times.gpu_rasterization.top_25_smooth' | 69 return 'gpu_times.gpu_rasterization.top_25_smooth' |
75 | 70 |
OLD | NEW |