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/page_cycler.py

Issue 733463005: telemetry: Fix page_cycler.netsim.top_10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put cache clearing logic back into SharedPageState. 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
« no previous file with comments | « tools/perf/benchmarks/page_cycler.py ('k') | no next file » | 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
(...skipping 13 matching lines...) Expand all
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_test 28 from telemetry.page import page_test
29 from telemetry.value import scalar 29 from telemetry.value import scalar
30 30
31 31
32 class PageCycler(page_test.PageTest): 32 class PageCycler(page_test.PageTest):
33 def __init__(self, page_repeat, pageset_repeat, cold_load_percent=50, 33 def __init__(self, page_repeat, pageset_repeat, cold_load_percent=50,
34 record_v8_object_stats=False, report_speed_index=False): 34 record_v8_object_stats=False, report_speed_index=False,
35 super(PageCycler, self).__init__() 35 clear_cache_before_each_run=False):
36 super(PageCycler, self).__init__(
37 clear_cache_before_each_run=clear_cache_before_each_run)
36 38
37 with open(os.path.join(os.path.dirname(__file__), 39 with open(os.path.join(os.path.dirname(__file__),
38 'page_cycler.js'), 'r') as f: 40 'page_cycler.js'), 'r') as f:
39 self._page_cycler_js = f.read() 41 self._page_cycler_js = f.read()
40 42
41 self._record_v8_object_stats = record_v8_object_stats 43 self._record_v8_object_stats = record_v8_object_stats
42 self._report_speed_index = report_speed_index 44 self._report_speed_index = report_speed_index
43 self._speedindex_metric = speedindex.SpeedIndexMetric() 45 self._speedindex_metric = speedindex.SpeedIndexMetric()
44 self._memory_metric = None 46 self._memory_metric = None
45 self._power_metric = None 47 self._power_metric = None
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 159
158 def ShouldRunCold(self, url): 160 def ShouldRunCold(self, url):
159 # We do the warm runs first for two reasons. The first is so we can 161 # We do the warm runs first for two reasons. The first is so we can
160 # preserve any initial profile cache for as long as possible. 162 # preserve any initial profile cache for as long as possible.
161 # The second is that, if we did cold runs first, we'd have a transition 163 # The second is that, if we did cold runs first, we'd have a transition
162 # page set during which we wanted the run for each URL to both 164 # page set during which we wanted the run for each URL to both
163 # contribute to the cold data and warm the catch for the following 165 # contribute to the cold data and warm the catch for the following
164 # warm run, and clearing the cache before the load of the following 166 # warm run, and clearing the cache before the load of the following
165 # URL would eliminate the intended warmup for the previous URL. 167 # URL would eliminate the intended warmup for the previous URL.
166 return (self._has_loaded_page[url] >= self._cold_run_start_index) 168 return (self._has_loaded_page[url] >= self._cold_run_start_index)
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/page_cycler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698