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

Side by Side Diff: tools/perf/measurements/rasterize_and_record_micro.py

Issue 809393002: Added support for improvement_direction to relevant values, which is propogated to chartjson. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix linter issues Created 5 years, 11 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
OLDNEW
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 import sys 5 import sys
6 import time 6 import time
7 7
8 from telemetry.core.util import TimeoutException 8 from telemetry.core.util import TimeoutException
9 from telemetry.page import page_test 9 from telemetry.page import page_test
10 from telemetry.value import improvement_direction
10 from telemetry.value import scalar 11 from telemetry.value import scalar
11 12
12 13
13 class RasterizeAndRecordMicro(page_test.PageTest): 14 class RasterizeAndRecordMicro(page_test.PageTest):
14 def __init__(self, start_wait_time=2, rasterize_repeat=100, record_repeat=100, 15 def __init__(self, start_wait_time=2, rasterize_repeat=100, record_repeat=100,
15 timeout=120, report_detailed_results=False): 16 timeout=120, report_detailed_results=False):
16 super(RasterizeAndRecordMicro, self).__init__('') 17 super(RasterizeAndRecordMicro, self).__init__('')
17 self._chrome_branch_number = None 18 self._chrome_branch_number = None
18 self._start_wait_time = start_wait_time 19 self._start_wait_time = start_wait_time
19 self._rasterize_repeat = rasterize_repeat 20 self._rasterize_repeat = rasterize_repeat
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 pixels_rasterized = data['pixels_rasterized'] 67 pixels_rasterized = data['pixels_rasterized']
67 rasterize_time = data['rasterize_time_ms'] 68 rasterize_time = data['rasterize_time_ms']
68 # TODO(schenney): Remove this workaround when reference builds get past 69 # TODO(schenney): Remove this workaround when reference builds get past
69 # the change that adds this comment. 70 # the change that adds this comment.
70 if ('picture_memory_usage' in data): 71 if ('picture_memory_usage' in data):
71 picture_memory_usage = data['picture_memory_usage'] 72 picture_memory_usage = data['picture_memory_usage']
72 else: 73 else:
73 picture_memory_usage = 0 74 picture_memory_usage = 0
74 75
75 results.AddValue(scalar.ScalarValue( 76 results.AddValue(scalar.ScalarValue(
76 results.current_page, 'pixels_recorded', 'pixels', pixels_recorded)) 77 results.current_page, 'pixels_recorded', 'pixels', pixels_recorded,
78 improvement_direction=improvement_direction.DOWN))
77 results.AddValue(scalar.ScalarValue( 79 results.AddValue(scalar.ScalarValue(
78 results.current_page, 'pixels_rasterized', 'pixels', pixels_rasterized)) 80 results.current_page, 'pixels_rasterized', 'pixels', pixels_rasterized,
81 improvement_direction=improvement_direction.DOWN))
79 results.AddValue(scalar.ScalarValue( 82 results.AddValue(scalar.ScalarValue(
80 results.current_page, 'rasterize_time', 'ms', rasterize_time)) 83 results.current_page, 'rasterize_time', 'ms', rasterize_time,
84 improvement_direction=improvement_direction.DOWN))
81 results.AddValue(scalar.ScalarValue( 85 results.AddValue(scalar.ScalarValue(
82 results.current_page, 'viewport_picture_size', 'bytes', 86 results.current_page, 'viewport_picture_size', 'bytes',
83 picture_memory_usage)) 87 picture_memory_usage,
88 improvement_direction=improvement_direction.DOWN))
84 results.AddValue(scalar.ScalarValue( 89 results.AddValue(scalar.ScalarValue(
85 results.current_page, 'record_time', 'ms', record_time)) 90 results.current_page, 'record_time', 'ms', record_time,
91 improvement_direction=improvement_direction.DOWN))
86 record_time_sk_null_canvas = data['record_time_sk_null_canvas_ms'] 92 record_time_sk_null_canvas = data['record_time_sk_null_canvas_ms']
87 record_time_painting_disabled = data['record_time_painting_disabled_ms'] 93 record_time_painting_disabled = data['record_time_painting_disabled_ms']
88 results.AddValue(scalar.ScalarValue( 94 results.AddValue(scalar.ScalarValue(
89 results.current_page, 'record_time_sk_null_canvas', 'ms', 95 results.current_page, 'record_time_sk_null_canvas', 'ms',
90 record_time_sk_null_canvas)) 96 record_time_sk_null_canvas,
97 improvement_direction=improvement_direction.DOWN))
91 results.AddValue(scalar.ScalarValue( 98 results.AddValue(scalar.ScalarValue(
92 results.current_page, 'record_time_painting_disabled', 'ms', 99 results.current_page, 'record_time_painting_disabled', 'ms',
93 record_time_painting_disabled)) 100 record_time_painting_disabled,
101 improvement_direction=improvement_direction.DOWN))
94 102
95 if self._report_detailed_results: 103 if self._report_detailed_results:
96 pixels_rasterized_with_non_solid_color = \ 104 pixels_rasterized_with_non_solid_color = \
97 data['pixels_rasterized_with_non_solid_color'] 105 data['pixels_rasterized_with_non_solid_color']
98 pixels_rasterized_as_opaque = \ 106 pixels_rasterized_as_opaque = \
99 data['pixels_rasterized_as_opaque'] 107 data['pixels_rasterized_as_opaque']
100 total_layers = data['total_layers'] 108 total_layers = data['total_layers']
101 total_picture_layers = data['total_picture_layers'] 109 total_picture_layers = data['total_picture_layers']
102 total_picture_layers_with_no_content = \ 110 total_picture_layers_with_no_content = \
103 data['total_picture_layers_with_no_content'] 111 data['total_picture_layers_with_no_content']
104 total_picture_layers_off_screen = \ 112 total_picture_layers_off_screen = \
105 data['total_picture_layers_off_screen'] 113 data['total_picture_layers_off_screen']
106 # TODO(schenney): Remove this workaround when reference builds get past 114 # TODO(schenney): Remove this workaround when reference builds get past
107 # the change that adds this comment. 115 # the change that adds this comment.
108 if ('total_pictures_in_pile_size' in data): 116 if ('total_pictures_in_pile_size' in data):
109 total_pictures_in_pile_size = data['total_pictures_in_pile_size'] 117 total_pictures_in_pile_size = data['total_pictures_in_pile_size']
110 else: 118 else:
111 total_pictures_in_pile_size = 0 119 total_pictures_in_pile_size = 0
112 120
113 results.AddValue(scalar.ScalarValue( 121 results.AddValue(scalar.ScalarValue(
114 results.current_page, 'total_size_of_pictures_in_piles', 'bytes', 122 results.current_page, 'total_size_of_pictures_in_piles', 'bytes',
115 total_pictures_in_pile_size)) 123 total_pictures_in_pile_size,
124 improvement_direction=improvement_direction.DOWN))
116 results.AddValue(scalar.ScalarValue( 125 results.AddValue(scalar.ScalarValue(
117 results.current_page, 'pixels_rasterized_with_non_solid_color', 126 results.current_page, 'pixels_rasterized_with_non_solid_color',
118 'pixels', pixels_rasterized_with_non_solid_color)) 127 'pixels', pixels_rasterized_with_non_solid_color,
128 improvement_direction=improvement_direction.DOWN))
119 results.AddValue(scalar.ScalarValue( 129 results.AddValue(scalar.ScalarValue(
120 results.current_page, 'pixels_rasterized_as_opaque', 'pixels', 130 results.current_page, 'pixels_rasterized_as_opaque', 'pixels',
121 pixels_rasterized_as_opaque)) 131 pixels_rasterized_as_opaque,
132 improvement_direction=improvement_direction.DOWN))
122 results.AddValue(scalar.ScalarValue( 133 results.AddValue(scalar.ScalarValue(
123 results.current_page, 'total_layers', 'count', total_layers)) 134 results.current_page, 'total_layers', 'count', total_layers,
135 improvement_direction=improvement_direction.DOWN))
124 results.AddValue(scalar.ScalarValue( 136 results.AddValue(scalar.ScalarValue(
125 results.current_page, 'total_picture_layers', 'count', 137 results.current_page, 'total_picture_layers', 'count',
126 total_picture_layers)) 138 total_picture_layers,
139 improvement_direction=improvement_direction.DOWN))
127 results.AddValue(scalar.ScalarValue( 140 results.AddValue(scalar.ScalarValue(
128 results.current_page, 'total_picture_layers_with_no_content', 'count', 141 results.current_page, 'total_picture_layers_with_no_content', 'count',
129 total_picture_layers_with_no_content)) 142 total_picture_layers_with_no_content,
143 improvement_direction=improvement_direction.DOWN))
130 results.AddValue(scalar.ScalarValue( 144 results.AddValue(scalar.ScalarValue(
131 results.current_page, 'total_picture_layers_off_screen', 'count', 145 results.current_page, 'total_picture_layers_off_screen', 'count',
132 total_picture_layers_off_screen)) 146 total_picture_layers_off_screen,
147 improvement_direction=improvement_direction.DOWN))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698