OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 telemetry import benchmark | 5 from telemetry import benchmark |
6 | 6 |
7 from benchmarks import silk_flags | 7 from benchmarks import silk_flags |
8 from measurements import thread_times | 8 from measurements import thread_times |
9 import page_sets | 9 import page_sets |
10 | 10 |
11 class _ThreadTimes(benchmark.Benchmark): | 11 class _ThreadTimes(benchmark.Benchmark): |
| 12 def __init__(self, measure_per_frame=True): |
| 13 super(_ThreadTimes, self).__init__() |
| 14 self._measure_per_frame = measure_per_frame |
| 15 |
12 @classmethod | 16 @classmethod |
13 def AddBenchmarkCommandLineArgs(cls, parser): | 17 def AddBenchmarkCommandLineArgs(cls, parser): |
14 parser.add_option('--report-silk-details', action='store_true', | 18 parser.add_option('--report-silk-details', action='store_true', |
15 help='Report details relevant to silk.') | 19 help='Report details relevant to silk.') |
16 | 20 |
17 @classmethod | 21 @classmethod |
18 def Name(cls): | 22 def Name(cls): |
19 return 'thread_times' | 23 return 'thread_times' |
20 | 24 |
21 def CreatePageTest(self, options): | 25 def CreatePageTest(self, options): |
22 return thread_times.ThreadTimes(options.report_silk_details) | 26 return thread_times.ThreadTimes(options.report_silk_details, |
| 27 self._measure_per_frame) |
23 | 28 |
24 | 29 |
25 @benchmark.Enabled('android') | 30 @benchmark.Enabled('android') |
26 class ThreadTimesKeySilkCases(_ThreadTimes): | 31 class ThreadTimesKeySilkCases(_ThreadTimes): |
27 """Measures timeline metrics while performing smoothness action on key silk | 32 """Measures timeline metrics while performing smoothness action on key silk |
28 cases.""" | 33 cases.""" |
29 page_set = page_sets.KeySilkCasesPageSet | 34 page_set = page_sets.KeySilkCasesPageSet |
30 | 35 |
31 @classmethod | 36 @classmethod |
32 def Name(cls): | 37 def Name(cls): |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 87 |
83 @benchmark.Enabled('android') | 88 @benchmark.Enabled('android') |
84 class ThreadTimesPolymer(_ThreadTimes): | 89 class ThreadTimesPolymer(_ThreadTimes): |
85 """Measures timeline metrics while performing smoothness action on | 90 """Measures timeline metrics while performing smoothness action on |
86 Polymer cases.""" | 91 Polymer cases.""" |
87 page_set = page_sets.PolymerPageSet | 92 page_set = page_sets.PolymerPageSet |
88 @classmethod | 93 @classmethod |
89 def Name(cls): | 94 def Name(cls): |
90 return 'thread_times.polymer' | 95 return 'thread_times.polymer' |
91 | 96 |
| 97 @benchmark.Enabled('android') |
| 98 class ThreadTimesKeyPowerCases(_ThreadTimes): |
| 99 """Measures timeline metrics for sites that should be idle in foreground |
| 100 and background scenarios. The metrics are aggregated rather than per-frame.""" |
| 101 page_set = page_sets.KeyPowerCasesPageSet |
| 102 |
| 103 def __init__(self): |
| 104 super(ThreadTimesKeyPowerCases, self).__init__(measure_per_frame=False) |
| 105 |
| 106 @classmethod |
| 107 def Name(cls): |
| 108 return 'thread_times.key_power_cases' |
OLD | NEW |