| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 class GpuRenderingStats(object): | 5 class GpuRenderingStats(object): |
| 6 def __init__(self, smoothness_marker, gesture_marker, rendering_stats_deltas, | 6 def __init__(self, smoothness_marker, gesture_marker, rendering_stats_deltas, |
| 7 used_gpu_benchmarking): | 7 used_gpu_benchmarking): |
| 8 """ | 8 """ |
| 9 Utility class for extracting rendering statistics from the timeline (or | 9 Utility class for extracting rendering statistics from the timeline (or |
| 10 other loggin facilities), and providing them in a common format to classes | 10 other loggin facilities), and providing them in a common format to classes |
| 11 that compute benchmark metrics from this data. | 11 that compute benchmark metrics from this data. |
| 12 | 12 |
| 13 Stats can either be numbers, or lists of numbers. Classes that calculate | 13 Stats can either be numbers, or lists of numbers. Classes that calculate |
| 14 metrics from the stats must be able to handle both cases. The length of | 14 metrics from the stats must be able to handle both cases. The length of |
| 15 different list stats may vary. | 15 different list stats may vary. |
| 16 | 16 |
| 17 All *_time values are measured in seconds. | 17 All *_time values are measured in seconds. |
| 18 """ | 18 """ |
| 19 self.renderer_process = smoothness_marker.start_thread.parent | 19 self.renderer_process = smoothness_marker.start_thread.parent |
| 20 self.start = gesture_marker.start | 20 self.start = gesture_marker.start |
| 21 self.end = self.start + gesture_marker.duration | 21 self.end = self.start + gesture_marker.duration |
| 22 | 22 |
| 23 self.total_time = (self.end - self.start) / 1000.0 | 23 self.total_time = (self.end - self.start) / 1000.0 |
| 24 self.animation_frame_count = [] | 24 self.animation_frame_count = [] |
| 25 self.screen_frame_count = [] | 25 self.screen_frame_count = [] |
| 26 self.screen_frame_timestamps = [] | 26 self.screen_frame_timestamps = [] |
| 27 self.paint_time = [] | 27 self.paint_time = [] |
| 28 self.record_time = [] | 28 self.record_time = [] |
| 29 self.best_record_time = [] |
| 29 self.commit_time = [] | 30 self.commit_time = [] |
| 30 self.commit_count = [] | 31 self.commit_count = [] |
| 31 self.painted_pixel_count = [] | 32 self.painted_pixel_count = [] |
| 32 self.recorded_pixel_count = [] | 33 self.recorded_pixel_count = [] |
| 33 self.image_gathering_count = [] | 34 self.image_gathering_count = [] |
| 34 self.image_gathering_time = [] | 35 self.image_gathering_time = [] |
| 35 self.dropped_frame_count = [] | 36 self.dropped_frame_count = [] |
| 36 self.rasterize_time = [] | 37 self.rasterize_time = [] |
| 37 self.rasterize_time_for_now_bins_on_pending_tree = [] | 38 self.rasterize_time_for_now_bins_on_pending_tree = [] |
| 38 self.best_rasterize_time = [] | 39 self.best_rasterize_time = [] |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 event.args['data']['animation_frame_count']) | 98 event.args['data']['animation_frame_count']) |
| 98 self.screen_frame_count.append( | 99 self.screen_frame_count.append( |
| 99 event.args['data']['screen_frame_count']) | 100 event.args['data']['screen_frame_count']) |
| 100 if event.args['data']['screen_frame_count'] == 1: | 101 if event.args['data']['screen_frame_count'] == 1: |
| 101 self.screen_frame_timestamps.append( | 102 self.screen_frame_timestamps.append( |
| 102 event.start) | 103 event.start) |
| 103 self.paint_time.append( | 104 self.paint_time.append( |
| 104 event.args['data']['paint_time']) | 105 event.args['data']['paint_time']) |
| 105 self.record_time.append( | 106 self.record_time.append( |
| 106 event.args['data']['record_time']) | 107 event.args['data']['record_time']) |
| 108 # TODO(ernstm): Remove this check when CL with best_record_time has |
| 109 # been picked up by the reference build. |
| 110 if 'best_record_time' in event.args['data']: |
| 111 self.best_record_time.append( |
| 112 event.args['data']['best_record_time']) |
| 107 self.commit_time.append( | 113 self.commit_time.append( |
| 108 event.args['data']['commit_time']) | 114 event.args['data']['commit_time']) |
| 109 self.commit_count.append( | 115 self.commit_count.append( |
| 110 event.args['data']['commit_count']) | 116 event.args['data']['commit_count']) |
| 111 self.painted_pixel_count.append( | 117 self.painted_pixel_count.append( |
| 112 event.args['data']['painted_pixel_count']) | 118 event.args['data']['painted_pixel_count']) |
| 113 self.recorded_pixel_count.append( | 119 self.recorded_pixel_count.append( |
| 114 event.args['data']['recorded_pixel_count']) | 120 event.args['data']['recorded_pixel_count']) |
| 115 self.image_gathering_count.append( | 121 self.image_gathering_count.append( |
| 116 event.args['data']['image_gathering_count']) | 122 event.args['data']['image_gathering_count']) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 self.deferred_image_cache_hit_count.append( | 159 self.deferred_image_cache_hit_count.append( |
| 154 event.args['data']['deferred_image_cache_hit_count']) | 160 event.args['data']['deferred_image_cache_hit_count']) |
| 155 self.tile_analysis_count.append( | 161 self.tile_analysis_count.append( |
| 156 event.args['data']['tile_analysis_count']) | 162 event.args['data']['tile_analysis_count']) |
| 157 self.solid_color_tile_analysis_count.append( | 163 self.solid_color_tile_analysis_count.append( |
| 158 event.args['data']['solid_color_tile_analysis_count']) | 164 event.args['data']['solid_color_tile_analysis_count']) |
| 159 self.deferred_image_decode_time.append( | 165 self.deferred_image_decode_time.append( |
| 160 event.args['data']['deferred_image_decode_time']) | 166 event.args['data']['deferred_image_decode_time']) |
| 161 self.tile_analysis_time.append( | 167 self.tile_analysis_time.append( |
| 162 event.args['data']['tile_analysis_time']) | 168 event.args['data']['tile_analysis_time']) |
| OLD | NEW |