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

Unified Diff: tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py

Issue 2561353002: tools: WPR support for testing speculative_prefetch_predictor. (Closed)
Patch Set: . Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/resource_prefetch_predictor/generate_database.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
diff --git a/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py b/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
index bd141fac28fce7a3bef5ddbbf8162cb48fd90742..1811c6dab30a48cb5662dab9ec8ff3006faeaea9 100755
--- a/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
+++ b/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
@@ -41,7 +41,7 @@ _INVALID_VALUE = -1
# Command line arguments for Chrome.
-_CHROME_ARGS = [
+CHROME_ARGS = [
# Disable backgound network requests that may pollute WPR archive, pollute
# HTTP cache generation, and introduce noise in loading performance.
'--disable-background-networking',
@@ -133,11 +133,10 @@ def RunOnce(device, url, warmup, speculation_mode, delay_to_may_launch_url,
return match.group(1) if match is not None else None
-Result = collections.namedtuple('Result', ['warmup', 'speculation_mode',
- 'delay_to_may_launch_url',
- 'delay_to_launch_url',
- 'commit', 'plt',
- 'first_contentful_paint'])
+RESULT_FIELDS = ('warmup', 'speculation_mode', 'delay_to_may_launch_url',
+ 'delay_to_launch_url', 'commit', 'plt',
+ 'first_contentful_paint')
+Result = collections.namedtuple('Result', RESULT_FIELDS)
def ParseResult(result_line):
@@ -181,7 +180,7 @@ def LoopOnDevice(device, configs, output_filename, wpr_archive_path=None,
try:
while should_stop is None or not should_stop.is_set():
config = configs[random.randint(0, len(configs) - 1)]
- chrome_args = _CHROME_ARGS + wpr_attributes.chrome_args
+ chrome_args = CHROME_ARGS + wpr_attributes.chrome_args
if config['speculation_mode'] == 'no_state_prefetch':
# NoStatePrefetch is enabled through an experiment.
chrome_args.extend([
@@ -218,7 +217,7 @@ def ProcessOutput(filename):
A numpy structured array.
"""
import numpy as np
- data = np.genfromtxt(filename, delimiter=',')
+ data = np.genfromtxt(filename, delimiter=',', skip_header=1)
result = np.array(np.zeros(len(data)),
dtype=[('warmup', bool), ('speculation_mode', np.int32),
('delay_to_may_launch_url', np.int32),
« no previous file with comments | « no previous file | tools/resource_prefetch_predictor/generate_database.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698