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

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

Issue 178943004: Rename tools/perf/metrics/io.py to resolve naming conflicts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: upload again after failed Created 6 years, 9 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/metrics/io.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 (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 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 13
14 Finally, various memory and IO statistics are gathered at the very end of 14 Finally, various memory and IO statistics are gathered at the very end of
15 cycling all pages. 15 cycling all pages.
16 """ 16 """
17 17
18 import collections 18 import collections
19 import os 19 import os
20 20
21 from metrics import cpu 21 from metrics import cpu
22 from metrics import io 22 from metrics import iometric
23 from metrics import memory 23 from metrics import memory
24 from metrics import power 24 from metrics import power
25 from metrics import speedindex 25 from metrics import speedindex
26 from metrics import v8_object_stats 26 from metrics import v8_object_stats
27 from telemetry.core import util 27 from telemetry.core import util
28 from telemetry.page import page_measurement 28 from telemetry.page import page_measurement
29 29
30 class PageCycler(page_measurement.PageMeasurement): 30 class PageCycler(page_measurement.PageMeasurement):
31 def __init__(self, *args, **kwargs): 31 def __init__(self, *args, **kwargs):
32 super(PageCycler, self).__init__(*args, **kwargs) 32 super(PageCycler, self).__init__(*args, **kwargs)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 # WillNavigateToPage once the cpu metric has been changed. 91 # WillNavigateToPage once the cpu metric has been changed.
92 # This is being temporarily commented out to let the page cycler 92 # This is being temporarily commented out to let the page cycler
93 # results return to how they were before the cpu metric was added. 93 # results return to how they were before the cpu metric was added.
94 # self._cpu_metric.Start(page, tab) See crbug.com/301714. 94 # self._cpu_metric.Start(page, tab) See crbug.com/301714.
95 if self._record_v8_object_stats: 95 if self._record_v8_object_stats:
96 self._v8_object_stats_metric.Start(page, tab) 96 self._v8_object_stats_metric.Start(page, tab)
97 97
98 def CustomizeBrowserOptions(self, options): 98 def CustomizeBrowserOptions(self, options):
99 memory.MemoryMetric.CustomizeBrowserOptions(options) 99 memory.MemoryMetric.CustomizeBrowserOptions(options)
100 power.PowerMetric.CustomizeBrowserOptions(options) 100 power.PowerMetric.CustomizeBrowserOptions(options)
101 io.IOMetric.CustomizeBrowserOptions(options) 101 iometric.IOMetric.CustomizeBrowserOptions(options)
102 options.AppendExtraBrowserArgs('--js-flags=--expose_gc') 102 options.AppendExtraBrowserArgs('--js-flags=--expose_gc')
103 103
104 if options.v8_object_stats: 104 if options.v8_object_stats:
105 self._record_v8_object_stats = True 105 self._record_v8_object_stats = True
106 v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options) 106 v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options)
107 107
108 if options.report_speed_index: 108 if options.report_speed_index:
109 self._report_speed_index = True 109 self._report_speed_index = True
110 self._speedindex_metric.CustomizeBrowserOptions(options) 110 self._speedindex_metric.CustomizeBrowserOptions(options)
111 111
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 if self._report_speed_index: 166 if self._report_speed_index:
167 def SpeedIndexIsFinished(): 167 def SpeedIndexIsFinished():
168 return self._speedindex_metric.IsFinished(tab) 168 return self._speedindex_metric.IsFinished(tab)
169 util.WaitFor(SpeedIndexIsFinished, 60) 169 util.WaitFor(SpeedIndexIsFinished, 60)
170 self._speedindex_metric.Stop(page, tab) 170 self._speedindex_metric.Stop(page, tab)
171 self._speedindex_metric.AddResults( 171 self._speedindex_metric.AddResults(
172 tab, results, chart_name=chart_name_prefix+'speed_index') 172 tab, results, chart_name=chart_name_prefix+'speed_index')
173 173
174 def DidRunTest(self, browser, results): 174 def DidRunTest(self, browser, results):
175 io.IOMetric().AddSummaryResults(browser, results) 175 iometric.IOMetric().AddSummaryResults(browser, results)
176 176
177 def IsRunCold(self, url): 177 def IsRunCold(self, url):
178 return (self.ShouldRunCold(url) or 178 return (self.ShouldRunCold(url) or
179 self._has_loaded_page[url] == 0) 179 self._has_loaded_page[url] == 0)
180 180
181 def ShouldRunCold(self, url): 181 def ShouldRunCold(self, url):
182 # We do the warm runs first for two reasons. The first is so we can 182 # We do the warm runs first for two reasons. The first is so we can
183 # preserve any initial profile cache for as long as possible. 183 # preserve any initial profile cache for as long as possible.
184 # The second is that, if we did cold runs first, we'd have a transition 184 # The second is that, if we did cold runs first, we'd have a transition
185 # page set during which we wanted the run for each URL to both 185 # page set during which we wanted the run for each URL to both
186 # contribute to the cold data and warm the catch for the following 186 # contribute to the cold data and warm the catch for the following
187 # warm run, and clearing the cache before the load of the following 187 # warm run, and clearing the cache before the load of the following
188 # URL would eliminate the intended warmup for the previous URL. 188 # URL would eliminate the intended warmup for the previous URL.
189 return (self._has_loaded_page[url] >= self._cold_run_start_index) 189 return (self._has_loaded_page[url] >= self._cold_run_start_index)
190 190
191 def results_are_the_same_on_every_page(self): 191 def results_are_the_same_on_every_page(self):
192 return False 192 return False
OLDNEW
« no previous file with comments | « no previous file | tools/perf/metrics/io.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698