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

Unified Diff: tools/resource_prefetch_predictor/prefetch_benchmark.py

Issue 2551913002: tools: Fixes in customtabs_benchmark. (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
Index: tools/resource_prefetch_predictor/prefetch_benchmark.py
diff --git a/tools/resource_prefetch_predictor/prefetch_benchmark.py b/tools/resource_prefetch_predictor/prefetch_benchmark.py
index 95be0212c9042992b3f66b6d574bf670ddc4a2a0..518af048f25af5731b9316fd67aa01dc56ce243f 100755
--- a/tools/resource_prefetch_predictor/prefetch_benchmark.py
+++ b/tools/resource_prefetch_predictor/prefetch_benchmark.py
@@ -48,6 +48,8 @@ def _CreateArgumentParser():
parser.add_argument('--url', help='URL to load.')
parser.add_argument('--prefetch_delay_ms',
help='Prefetch delay in ms. -1 to disable prefetch.')
+ parser.add_argument('--output_filename',
+ help='CSV file to append the result to.')
return parser
@@ -97,9 +99,9 @@ def _Go(device, url, prefetch_delay_ms):
result = customtabs_benchmark.RunOnce(
device, url, warmup=True, speculation_mode=prefetch_mode,
delay_to_may_launch_url=2000,
- delay_to_launch_url=max(0, prefetch_delay_ms), cold=False,
+ delay_to_launch_url=prefetch_delay_ms, cold=False,
chrome_args=chrome_args, reset_chrome_state=False)
- print customtabs_benchmark.ParseResult(result)
+ return customtabs_benchmark.ParseResult(result)
def main():
@@ -115,7 +117,10 @@ def main():
sys.exit(1)
_Setup(device, args.database)
- _Go(device, args.url, int(args.prefetch_delay_ms))
+ result = _Go(device, args.url, int(args.prefetch_delay_ms))
+ print result
+ with open(args.output_filename, 'a') as f:
+ f.write(','.join(str(x) for x in result) + '\n')
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698