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 core import perf_benchmark | 5 from core import perf_benchmark |
6 | 6 |
7 from measurements import webrtc | |
8 import page_sets | 7 import page_sets |
9 from telemetry import benchmark | 8 from telemetry import benchmark |
10 from telemetry.timeline import chrome_trace_category_filter | 9 from telemetry.timeline import chrome_trace_category_filter |
11 from telemetry.web_perf import timeline_based_measurement | 10 from telemetry.web_perf import timeline_based_measurement |
12 from telemetry.web_perf.metrics import webrtc_rendering_timeline | |
13 | |
14 RENDERING_VALUE_PREFIX = 'WebRTCRendering_' | |
15 | |
16 # TODO(qyearsley, mcasas): Add webrtc.audio when http://crbug.com/468732 | |
17 # is fixed, or revert https://codereview.chromium.org/1544573002/ when | |
18 # http://crbug.com/568333 is fixed. | |
19 | 11 |
20 | 12 |
21 class _Webrtc(perf_benchmark.PerfBenchmark): | 13 @benchmark.Owner(emails=['qiangchen@chromium.org', # For smoothness metrics |
14 'ehmaldonado@chromium.org', | |
15 'phoglund@chromium.org']) | |
16 class WebrtcPerfBenchmark(perf_benchmark.PerfBenchmark): | |
22 """Base class for WebRTC metrics for real-time communications tests.""" | 17 """Base class for WebRTC metrics for real-time communications tests.""" |
23 test = webrtc.WebRTC | 18 page_set = page_sets.WebrtcPageSet |
24 | |
25 | |
26 class WebrtcGetusermedia(_Webrtc): | |
27 """Measures WebRtc GetUserMedia for video capture and local playback.""" | |
28 page_set = page_sets.WebrtcGetusermediaPageSet | |
29 | 19 |
30 @classmethod | 20 @classmethod |
31 def Name(cls): | 21 def Name(cls): |
32 return 'webrtc.getusermedia' | 22 return 'webrtc.perf_benchmark' |
nednguyen
2017/05/15 16:55:00
Just name this webrtc. The 'perf_benchmark' part d
ehmaldonado_chromium
2017/05/16 08:36:28
Done.
| |
33 | |
34 | |
35 class WebrtcPeerConnection(_Webrtc): | |
36 """Measures WebRtc Peerconnection for remote video and audio communication.""" | |
37 page_set = page_sets.WebrtcPeerconnectionPageSet | |
38 | |
39 @classmethod | |
40 def Name(cls): | |
41 return 'webrtc.peerconnection' | |
42 | |
43 | |
44 @benchmark.Owner(emails=['phoglund@chromium.org']) | |
45 class WebrtcDataChannel(_Webrtc): | |
46 """Measures WebRtc DataChannel loopback.""" | |
47 page_set = page_sets.WebrtcDatachannelPageSet | |
48 | |
49 @classmethod | |
50 def Name(cls): | |
51 return 'webrtc.datachannel' | |
52 | |
53 | |
54 @benchmark.Disabled('win') | |
55 @benchmark.Owner(emails=['ehmaldonado@chromium.org', 'phoglund@chromium.org']) | |
56 class WebrtcStressTest(perf_benchmark.PerfBenchmark): | |
57 """Measures WebRtc CPU and GPU usage with multiple peer connections.""" | |
58 page_set = page_sets.WebrtcStresstestPageSet | |
59 | |
60 @classmethod | |
61 def Name(cls): | |
62 return 'webrtc.stress' | |
63 | |
64 def CreatePageTest(self, options): | |
65 # Exclude all stats. | |
66 return webrtc.WebRTC(particular_metrics=['googAvgEncodeMs', | |
67 'googFrameRateReceived']) | |
68 | |
69 | |
70 # WebrtcRendering must be a PerfBenchmark, and not a _Webrtc, because it is a | |
71 # timeline-based. | |
72 # Disabled on reference builds because they crash and don't support tab | |
73 # capture. See http://crbug.com/603232. | |
74 @benchmark.Disabled('reference') | |
75 @benchmark.Disabled('android') # http://crbug.com/610019 | |
76 @benchmark.Owner(emails=['qiangchen@chromium.org']) | |
77 class WebrtcRendering(perf_benchmark.PerfBenchmark): | |
78 """Specific time measurements (e.g. fps, smoothness) for WebRtc rendering.""" | |
79 | |
80 page_set = page_sets.WebrtcRenderingPageSet | |
81 | 23 |
82 def CreateTimelineBasedMeasurementOptions(self): | 24 def CreateTimelineBasedMeasurementOptions(self): |
25 categories = [ | |
26 # Disable all categories by default. | |
27 '-*', | |
28 # EQT categories | |
29 # 'blink.user_timing', | |
30 # 'loading', | |
31 # 'navigation', | |
32 # 'toplevel', | |
nednguyen
2017/05/15 16:55:00
Without 'toplevel', cpuTimeMetric doesn't work
ehmaldonado_chromium
2017/05/16 08:36:28
Acknowledged.
| |
33 # WebRTC | |
34 'webrtc', | |
35 ] | |
36 | |
83 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( | 37 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( |
84 filter_string='webrtc,webkit.console,blink.console') | 38 filter_string=','.join(categories)) |
85 options = timeline_based_measurement.Options(category_filter) | |
86 options.SetLegacyTimelineBasedMetrics( | |
87 [webrtc_rendering_timeline.WebRtcRenderingTimelineMetric()]) | |
88 return options | |
89 | |
90 def SetExtraBrowserOptions(self, options): | |
91 options.AppendExtraBrowserArgs('--use-fake-device-for-media-stream') | |
92 options.AppendExtraBrowserArgs('--use-fake-ui-for-media-stream') | |
93 | |
94 @classmethod | |
95 def Name(cls): | |
96 return 'webrtc.webrtc_smoothness' | |
97 | |
98 | |
99 # WebrtcRenderingTBMv2 must be a PerfBenchmark, and not a _Webrtc, because it is | |
100 # a timeline-based metric. | |
101 @benchmark.Owner(emails=['ehmaldonado@chromium.org', | |
102 'phoglund@chromium.org', | |
103 'qiangchen@chromium.org']) | |
104 class WebrtcRenderingTBMv2(perf_benchmark.PerfBenchmark): | |
105 """Specific time measurements (e.g. fps, smoothness) for WebRtc rendering.""" | |
106 | |
107 page_set = page_sets.WebrtcRenderingPageSet | |
108 | |
109 def CreateTimelineBasedMeasurementOptions(self): | |
110 category_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter( | |
111 filter_string='webrtc,toplevel') | |
112 options = timeline_based_measurement.Options(category_filter) | 39 options = timeline_based_measurement.Options(category_filter) |
113 options.SetTimelineBasedMetrics([ | 40 options.SetTimelineBasedMetrics([ |
114 'cpuTimeMetric', | 41 'cpuTimeMetric', |
115 'expectedQueueingTimeMetric', | 42 # 'expectedQueueingTimeMetric', |
nednguyen
2017/05/15 16:55:00
Add comment linking to bug to enable this
ehmaldonado_chromium
2017/05/16 08:36:28
The bug seems to have been fixed in https://codere
| |
116 'webrtcRenderingMetric', | 43 'webrtcRenderingMetric', |
117 ]) | 44 ]) |
118 return options | 45 return options |
119 | 46 |
120 def SetExtraBrowserOptions(self, options): | 47 def SetExtraBrowserOptions(self, options): |
121 options.AppendExtraBrowserArgs('--use-fake-device-for-media-stream') | 48 options.AppendExtraBrowserArgs('--use-fake-device-for-media-stream') |
122 options.AppendExtraBrowserArgs('--use-fake-ui-for-media-stream') | 49 options.AppendExtraBrowserArgs('--use-fake-ui-for-media-stream') |
123 | |
124 @classmethod | |
125 def Name(cls): | |
126 return 'webrtc.webrtc_smoothness_tbmv2' | |
OLD | NEW |