| 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 @classmethod | 12 @classmethod |
| 13 def AddBenchmarkCommandLineArgs(cls, parser): | 13 def AddBenchmarkCommandLineArgs(cls, parser): |
| 14 parser.add_option('--report-silk-details', action='store_true', | 14 parser.add_option('--report-silk-details', action='store_true', |
| 15 help='Report details relevant to silk.') | 15 help='Report details relevant to silk.') |
| 16 | 16 |
| 17 @classmethod | 17 @classmethod |
| 18 def Name(cls): | 18 def Name(cls): |
| 19 return 'thread_times' | 19 return 'thread_times' |
| 20 | 20 |
| 21 @classmethod |
| 22 def ValueCanBeAddedPredicate(cls, value, _): |
| 23 # Default to only reporting per-frame metrics. |
| 24 return 'per_ms' not in value.name |
| 25 |
| 21 def CreatePageTest(self, options): | 26 def CreatePageTest(self, options): |
| 22 return thread_times.ThreadTimes(options.report_silk_details) | 27 return thread_times.ThreadTimes(options.report_silk_details) |
| 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 |
| (...skipping 51 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 |
| OLD | NEW |