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

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

Issue 2743773002: Port part of media.tough_video_cases to TBMv2 (Closed)
Patch Set: Rebase 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.Owner(emails=['johnchen@chromium.org', 'crouleau@chromium.org'],
56 component='Internals>Media')
57 @benchmark.Disabled('android')
58 class MediaToughVideoCasesTBMv2(perf_benchmark.PerfBenchmark):
59 """Obtains media metrics using TBMv2.
60 Will eventually replace MediaToughVideoCases class."""
61 page_set = page_sets.ToughVideoCasesPageSet
62
63 def CreateTimelineBasedMeasurementOptions(self):
64 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter()
65
66 # 'toplevel' category provides CPU time slices used by # cpuTimeMetric.
67 category_filter.AddIncludedCategory('toplevel')
68
69 # 'rail' category is used by powerMetric to attribute different period of
70 # time to different activities, such as video_animation, etc.
71 category_filter.AddIncludedCategory('rail')
72
73 options = timeline_based_measurement.Options(category_filter)
74 options.config.enable_atrace_trace = True
75 options.config.atrace_config.categories = ['sched']
76 options.config.enable_battor_trace = True
77 options.SetTimelineBasedMetrics(['powerMetric', 'cpuTimeMetric'])
78 return options
79
80 @classmethod
81 def Name(cls):
82 return 'media.tough_video_cases_tbmv2'
83
84
53 # crbug.com/565180: Only include cases that don't report time_to_play 85 # crbug.com/565180: Only include cases that don't report time_to_play
54 @benchmark.Disabled('android') 86 @benchmark.Disabled('android')
55 @benchmark.Owner(emails=['crouleau@chromium.org', 'videostack-eng@google.com']) 87 @benchmark.Owner(emails=['crouleau@chromium.org', 'videostack-eng@google.com'])
56 class MediaExtra(perf_benchmark.PerfBenchmark): 88 class MediaExtra(perf_benchmark.PerfBenchmark):
57 """Obtains extra media metrics for key user scenarios.""" 89 """Obtains extra media metrics for key user scenarios."""
58 test = media.Media 90 test = media.Media
59 page_set = page_sets.ToughVideoCasesExtraPageSet 91 page_set = page_sets.ToughVideoCasesExtraPageSet
60 92
61 @classmethod 93 @classmethod
62 def Name(cls): 94 def Name(cls):
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 172
141 @classmethod 173 @classmethod
142 def Name(cls): 174 def Name(cls):
143 return 'media.mse_cases' 175 return 'media.mse_cases'
144 176
145 def SetExtraBrowserOptions(self, options): 177 def SetExtraBrowserOptions(self, options):
146 # Needed to allow XHR requests to return stream objects. 178 # Needed to allow XHR requests to return stream objects.
147 options.AppendExtraBrowserArgs( 179 options.AppendExtraBrowserArgs(
148 ['--enable-experimental-web-platform-features', 180 ['--enable-experimental-web-platform-features',
149 '--disable-gesture-requirement-for-media-playback']) 181 '--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