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

Side by Side Diff: tools/telemetry/telemetry/web_perf/metrics/rendering_stats.py

Issue 707963003: cc: Remove main thread rendering stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed class member initialization :( Created 6 years, 1 month 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
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 from operator import attrgetter 4 from operator import attrgetter
5 5
6 from telemetry.web_perf.metrics import rendering_frame 6 from telemetry.web_perf.metrics import rendering_frame
7 7
8 # These are LatencyInfo component names indicating the various components 8 # These are LatencyInfo component names indicating the various components
9 # that the input event has travelled through. 9 # that the input event has travelled through.
10 # This is when the input event first reaches chrome. 10 # This is when the input event first reaches chrome.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 timestamp_process = renderer_process 134 timestamp_process = renderer_process
135 135
136 timestamp_event_name = GetTimestampEventName(timestamp_process) 136 timestamp_event_name = GetTimestampEventName(timestamp_process)
137 137
138 # A lookup from list names below to any errors or exceptions encountered 138 # A lookup from list names below to any errors or exceptions encountered
139 # in attempting to generate that list. 139 # in attempting to generate that list.
140 self.errors = {} 140 self.errors = {}
141 141
142 self.frame_timestamps = [] 142 self.frame_timestamps = []
143 self.frame_times = [] 143 self.frame_times = []
144 self.paint_times = []
145 self.painted_pixel_counts = []
146 self.record_times = []
147 self.recorded_pixel_counts = []
148 self.approximated_pixel_percentages = [] 144 self.approximated_pixel_percentages = []
149 # End-to-end latency for input event - from when input event is 145 # End-to-end latency for input event - from when input event is
150 # generated to when the its resulted page is swap buffered. 146 # generated to when the its resulted page is swap buffered.
151 self.input_event_latency = [] 147 self.input_event_latency = []
152 self.frame_queueing_durations = [] 148 self.frame_queueing_durations = []
153 # Latency from when a scroll update is sent to the main thread until the 149 # Latency from when a scroll update is sent to the main thread until the
154 # resulting frame is swapped. 150 # resulting frame is swapped.
155 self.scroll_update_latency = [] 151 self.scroll_update_latency = []
156 # Latency for a GestureScrollUpdate input event. 152 # Latency for a GestureScrollUpdate input event.
157 self.gesture_scroll_update_latency = [] 153 self.gesture_scroll_update_latency = []
158 154
159 for timeline_range in timeline_ranges: 155 for timeline_range in timeline_ranges:
160 self.frame_timestamps.append([]) 156 self.frame_timestamps.append([])
161 self.frame_times.append([]) 157 self.frame_times.append([])
162 self.paint_times.append([])
163 self.painted_pixel_counts.append([])
164 self.record_times.append([])
165 self.recorded_pixel_counts.append([])
166 self.approximated_pixel_percentages.append([]) 158 self.approximated_pixel_percentages.append([])
167 self.input_event_latency.append([]) 159 self.input_event_latency.append([])
168 self.scroll_update_latency.append([]) 160 self.scroll_update_latency.append([])
169 self.gesture_scroll_update_latency.append([]) 161 self.gesture_scroll_update_latency.append([])
170 162
171 if timeline_range.is_empty: 163 if timeline_range.is_empty:
172 continue 164 continue
173 self._InitFrameTimestampsFromTimeline( 165 self._InitFrameTimestampsFromTimeline(
174 timestamp_process, timestamp_event_name, timeline_range) 166 timestamp_process, timestamp_event_name, timeline_range)
175 self._InitMainThreadRenderingStatsFromTimeline(
176 renderer_process, timeline_range)
177 self._InitImplThreadRenderingStatsFromTimeline( 167 self._InitImplThreadRenderingStatsFromTimeline(
178 renderer_process, timeline_range) 168 renderer_process, timeline_range)
179 self._InitInputLatencyStatsFromTimeline( 169 self._InitInputLatencyStatsFromTimeline(
180 browser_process, renderer_process, timeline_range) 170 browser_process, renderer_process, timeline_range)
181 self._InitFrameQueueingDurationsFromTimeline( 171 self._InitFrameQueueingDurationsFromTimeline(
182 renderer_process, timeline_range) 172 renderer_process, timeline_range)
183 173
184 def _InitInputLatencyStatsFromTimeline( 174 def _InitInputLatencyStatsFromTimeline(
185 self, browser_process, renderer_process, timeline_range): 175 self, browser_process, renderer_process, timeline_range):
186 latency_events = GetInputLatencyEvents(browser_process, timeline_range) 176 latency_events = GetInputLatencyEvents(browser_process, timeline_range)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 if len(self.frame_timestamps[-1]) >= 2: 211 if len(self.frame_timestamps[-1]) >= 2:
222 self.frame_times[-1].append(round(self.frame_timestamps[-1][-1] - 212 self.frame_times[-1].append(round(self.frame_timestamps[-1][-1] -
223 self.frame_timestamps[-1][-2], 2)) 213 self.frame_timestamps[-1][-2], 2))
224 214
225 def _InitFrameTimestampsFromTimeline( 215 def _InitFrameTimestampsFromTimeline(
226 self, process, timestamp_event_name, timeline_range): 216 self, process, timestamp_event_name, timeline_range):
227 for event in self._GatherEvents( 217 for event in self._GatherEvents(
228 timestamp_event_name, process, timeline_range): 218 timestamp_event_name, process, timeline_range):
229 self._AddFrameTimestamp(event) 219 self._AddFrameTimestamp(event)
230 220
231 def _InitMainThreadRenderingStatsFromTimeline(self, process, timeline_range):
232 event_name = 'BenchmarkInstrumentation::MainThreadRenderingStats'
233 for event in self._GatherEvents(event_name, process, timeline_range):
234 data = event.args['data']
235 self.paint_times[-1].append(1000.0 * data['paint_time'])
236 self.painted_pixel_counts[-1].append(data['painted_pixel_count'])
237 self.record_times[-1].append(1000.0 * data['record_time'])
238 self.recorded_pixel_counts[-1].append(data['recorded_pixel_count'])
239
240 def _InitImplThreadRenderingStatsFromTimeline(self, process, timeline_range): 221 def _InitImplThreadRenderingStatsFromTimeline(self, process, timeline_range):
241 event_name = 'BenchmarkInstrumentation::ImplThreadRenderingStats' 222 event_name = 'BenchmarkInstrumentation::ImplThreadRenderingStats'
242 for event in self._GatherEvents(event_name, process, timeline_range): 223 for event in self._GatherEvents(event_name, process, timeline_range):
243 data = event.args['data'] 224 data = event.args['data']
244 if data.get('visible_content_area', 0): 225 if data.get('visible_content_area', 0):
245 self.approximated_pixel_percentages[-1].append( 226 self.approximated_pixel_percentages[-1].append(
246 round(float(data['approximated_visible_content_area']) / 227 round(float(data['approximated_visible_content_area']) /
247 float(data['visible_content_area']) * 100.0, 3)) 228 float(data['visible_content_area']) * 100.0, 3))
248 else: 229 else:
249 self.approximated_pixel_percentages[-1].append(0.0) 230 self.approximated_pixel_percentages[-1].append(0.0)
250 231
251 def _InitFrameQueueingDurationsFromTimeline(self, process, timeline_range): 232 def _InitFrameQueueingDurationsFromTimeline(self, process, timeline_range):
252 try: 233 try:
253 events = rendering_frame.GetFrameEventsInsideRange(process, 234 events = rendering_frame.GetFrameEventsInsideRange(process,
254 timeline_range) 235 timeline_range)
255 new_frame_queueing_durations = [e.queueing_duration for e in events] 236 new_frame_queueing_durations = [e.queueing_duration for e in events]
256 self.frame_queueing_durations.append(new_frame_queueing_durations) 237 self.frame_queueing_durations.append(new_frame_queueing_durations)
257 except rendering_frame.NoBeginFrameIdException: 238 except rendering_frame.NoBeginFrameIdException:
258 self.errors['frame_queueing_durations'] = ( 239 self.errors['frame_queueing_durations'] = (
259 'Current chrome version does not support the queueing delay metric.') 240 'Current chrome version does not support the queueing delay metric.')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698