Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: tools/perf/benchmarks/media.py

Issue 2743773002: Port part of media.tough_video_cases to TBMv2 (Closed)
Patch Set: Combine battor.tough_video_cases with new benchmark Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/perf/benchmarks/battor.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 core import perf_benchmark 5 from core import perf_benchmark
6 6
7 from telemetry import benchmark 7 from telemetry import benchmark
8 from telemetry.page import legacy_page_test 8 from telemetry.page import legacy_page_test
9 from telemetry.timeline import chrome_trace_category_filter
9 from telemetry.value import list_of_scalar_values 10 from telemetry.value import list_of_scalar_values
10 from telemetry.value import scalar 11 from telemetry.value import scalar
12 from telemetry.web_perf import timeline_based_measurement
11 13
12 from measurements import media 14 from measurements import media
13 import page_sets 15 import page_sets
14 16
15 17
16 class _MSEMeasurement(legacy_page_test.LegacyPageTest): 18 class _MSEMeasurement(legacy_page_test.LegacyPageTest):
17 19
18 def __init__(self): 20 def __init__(self):
19 super(_MSEMeasurement, self).__init__() 21 super(_MSEMeasurement, self).__init__()
20 22
(...skipping 12 matching lines...) Expand all
33 35
34 else: 36 else:
35 results.AddValue(scalar.ScalarValue( 37 results.AddValue(scalar.ScalarValue(
36 results.current_page, trace_name, units='ms', 38 results.current_page, trace_name, units='ms',
37 value=float(metrics[m]), important=True)) 39 value=float(metrics[m]), important=True))
38 40
39 41
40 # android: See media.android.tough_video_cases below 42 # android: See media.android.tough_video_cases below
41 # crbug.com/565180: Only include cases that report time_to_play 43 # crbug.com/565180: Only include cases that report time_to_play
42 @benchmark.Disabled('android') 44 @benchmark.Disabled('android')
43 class Media(perf_benchmark.PerfBenchmark): 45 class MediaToughVideoCases(perf_benchmark.PerfBenchmark):
44 """Obtains media metrics for key user scenarios.""" 46 """Obtains media metrics for key user scenarios."""
45 test = media.Media 47 test = media.Media
46 page_set = page_sets.ToughVideoCasesPageSet 48 page_set = page_sets.ToughVideoCasesPageSet
47 49
48 @classmethod 50 @classmethod
49 def Name(cls): 51 def Name(cls):
50 return 'media.tough_video_cases' 52 return 'media.tough_video_cases'
51 53
52 54
55 @benchmark.Disabled('android')
56 class MediaToughVideoCasesTBMv2(perf_benchmark.PerfBenchmark):
watk 2017/03/14 00:08:45 Not a comment for this CL, just a naming bikeshed
CalebRouleau 2017/03/14 00:12:46 John and I already discussed this. Our current ide
charliea (OOO until 10-5) 2017/03/14 19:04:20 nednguyen@google.com: if I understand your long-te
57 """Obtains media metrics using TBMv2. Will eventually replace Media class."""
58 page_set = page_sets.ToughVideoCasesPageSet
59
60 def CreateTimelineBasedMeasurementOptions(self):
61 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter(
62 filter_string='toplevel')
63 options = timeline_based_measurement.Options(category_filter)
64 options.config.chrome_trace_config.category_filter.AddFilterString('rail')
watk 2017/03/14 00:08:45 nit: it's weird that you add "toplevel" above and
65 options.config.enable_atrace_trace = True
66 options.config.atrace_config.categories = ['sched']
67 options.config.enable_battor_trace = True
68 options.SetTimelineBasedMetrics(['powerMetric', 'cpuTimeMetric'])
69 return options
70
71 @classmethod
72 def Name(cls):
73 return 'media.tough_video_cases_tbmv2'
74
75
53 # crbug.com/565180: Only include cases that don't report time_to_play 76 # crbug.com/565180: Only include cases that don't report time_to_play
54 @benchmark.Disabled('android') 77 @benchmark.Disabled('android')
55 class MediaExtra(perf_benchmark.PerfBenchmark): 78 class MediaExtra(perf_benchmark.PerfBenchmark):
56 """Obtains extra media metrics for key user scenarios.""" 79 """Obtains extra media metrics for key user scenarios."""
57 test = media.Media 80 test = media.Media
58 page_set = page_sets.ToughVideoCasesExtraPageSet 81 page_set = page_sets.ToughVideoCasesExtraPageSet
59 82
60 @classmethod 83 @classmethod
61 def Name(cls): 84 def Name(cls):
62 return 'media.tough_video_cases_extra' 85 return 'media.tough_video_cases_extra'
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 160
138 @classmethod 161 @classmethod
139 def Name(cls): 162 def Name(cls):
140 return 'media.mse_cases' 163 return 'media.mse_cases'
141 164
142 def SetExtraBrowserOptions(self, options): 165 def SetExtraBrowserOptions(self, options):
143 # Needed to allow XHR requests to return stream objects. 166 # Needed to allow XHR requests to return stream objects.
144 options.AppendExtraBrowserArgs( 167 options.AppendExtraBrowserArgs(
145 ['--enable-experimental-web-platform-features', 168 ['--enable-experimental-web-platform-features',
146 '--disable-gesture-requirement-for-media-playback']) 169 '--disable-gesture-requirement-for-media-playback'])
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/battor.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698