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

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

Issue 2029483002: [PCv1] Avoid using dot in metrics name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 4 years, 6 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 | « no previous file | tools/perf/measurements/page_cycler_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 The Chromium Authors. All rights reserved. 1 # Copyright 2012 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 """The page cycler measurement. 5 """The page cycler measurement.
6 6
7 This measurement registers a window load handler in which is forces a layout and 7 This measurement registers a window load handler in which is forces a layout and
8 then records the value of performance.now(). This call to now() measures the 8 then records the value of performance.now(). This call to now() measures the
9 time from navigationStart (immediately after the previous page's beforeunload 9 time from navigationStart (immediately after the previous page's beforeunload
10 event) until after the layout in the page's load event. In addition, two garbage 10 event) until after the layout in the page's load event. In addition, two garbage
11 collections are performed in between the page loads (in the beforeunload event). 11 collections are performed in between the page loads (in the beforeunload event).
12 This extra garbage collection time is not included in the measurement times. 12 This extra garbage collection time is not included in the measurement times.
13
14 Finally, various memory and IO statistics are gathered at the very end of 13 Finally, various memory and IO statistics are gathered at the very end of
15 cycling all pages. 14 cycling all pages.
16 """ 15 """
17 16
18 import collections 17 import collections
19 import os 18 import os
20 19
21 from telemetry.core import util 20 from telemetry.core import util
22 from telemetry.page import legacy_page_test 21 from telemetry.page import legacy_page_test
23 from telemetry.value import scalar 22 from telemetry.value import scalar
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 103
105 keychain_metric.KeychainMetric.CustomizeBrowserOptions(options) 104 keychain_metric.KeychainMetric.CustomizeBrowserOptions(options)
106 105
107 def ValidateAndMeasurePage(self, page, tab, results): 106 def ValidateAndMeasurePage(self, page, tab, results):
108 tab.WaitForJavaScriptExpression('__pc_load_time', 60) 107 tab.WaitForJavaScriptExpression('__pc_load_time', 60)
109 108
110 chart_name_prefix = ('cold_' if self.IsRunCold(page.url) else 109 chart_name_prefix = ('cold_' if self.IsRunCold(page.url) else
111 'warm_') 110 'warm_')
112 111
113 results.AddValue(scalar.ScalarValue( 112 results.AddValue(scalar.ScalarValue(
113 results.current_page, '%stimes-page_load_time' % chart_name_prefix,
114 'ms', tab.EvaluateJavaScript('__pc_load_time'),
115 description='Average page load time. Measured from '
116 'performance.timing.navigationStart until the completion '
117 'time of a layout after the window.load event. Cold times '
118 'are the times when the page is loaded cold, i.e. without '
119 'loading it before, and warm times are times when the '
120 'page is loaded after being loaded previously.'))
121 results.AddValue(scalar.ScalarValue(
122 results.current_page, '%stimes-time_to_onload' % chart_name_prefix,
123 'ms', tab.EvaluateJavaScript('performance.timing.loadEventStart'
124 '- performance.timing.navigationStart'),
125 description='Time to onload. This is temporary metric to check that '
126 'PCv1 and PCv2 emit similar results'))
127
128 # TODO(kouhei): Remove below. crbug.com/616342
129 results.AddValue(scalar.ScalarValue(
114 results.current_page, '%stimes.page_load_time' % chart_name_prefix, 130 results.current_page, '%stimes.page_load_time' % chart_name_prefix,
115 'ms', tab.EvaluateJavaScript('__pc_load_time'), 131 'ms', tab.EvaluateJavaScript('__pc_load_time'),
116 description='Average page load time. Measured from ' 132 description='Average page load time. Measured from '
117 'performance.timing.navigationStart until the completion ' 133 'performance.timing.navigationStart until the completion '
118 'time of a layout after the window.load event. Cold times ' 134 'time of a layout after the window.load event. Cold times '
119 'are the times when the page is loaded cold, i.e. without ' 135 'are the times when the page is loaded cold, i.e. without '
120 'loading it before, and warm times are times when the ' 136 'loading it before, and warm times are times when the '
121 'page is loaded after being loaded previously.')) 137 'page is loaded after being loaded previously.'))
122 results.AddValue(scalar.ScalarValue( 138 results.AddValue(scalar.ScalarValue(
123 results.current_page, '%stimes.time_to_onload' % chart_name_prefix, 139 results.current_page, '%stimes.time_to_onload' % chart_name_prefix,
(...skipping 29 matching lines...) Expand all
153 # preserve any initial profile cache for as long as possible. 169 # preserve any initial profile cache for as long as possible.
154 # The second is that, if we did cold runs first, we'd have a transition 170 # The second is that, if we did cold runs first, we'd have a transition
155 # page set during which we wanted the run for each URL to both 171 # page set during which we wanted the run for each URL to both
156 # contribute to the cold data and warm the catch for the following 172 # contribute to the cold data and warm the catch for the following
157 # warm run, and clearing the cache before the load of the following 173 # warm run, and clearing the cache before the load of the following
158 # URL would eliminate the intended warmup for the previous URL. 174 # URL would eliminate the intended warmup for the previous URL.
159 return self._has_loaded_page[url] >= self._cold_run_start_index 175 return self._has_loaded_page[url] >= self._cold_run_start_index
160 176
161 def DidRunPage(self, platform): 177 def DidRunPage(self, platform):
162 self._power_metric.Close() 178 self._power_metric.Close()
OLDNEW
« no previous file with comments | « no previous file | tools/perf/measurements/page_cycler_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698