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

Unified Diff: tools/android/loading/sandwich.py

Issue 1872313002: sandwich: Implement SandwichTaskBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/android/loading/sandwich_misc.py » ('j') | tools/android/loading/sandwich_tasks.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/sandwich.py
diff --git a/tools/android/loading/sandwich.py b/tools/android/loading/sandwich.py
index 5f61aac31553afeed8eae0be89f4372c147ed7e0..4d1a1839f0b226829d120afea8bb85730aea369c 100755
--- a/tools/android/loading/sandwich.py
+++ b/tools/android/loading/sandwich.py
@@ -35,6 +35,8 @@ import options
import sandwich_metrics
import sandwich_misc
from sandwich_runner import SandwichRunner
+import sandwich_tasks
+import task_manager
from trace_test.webserver_test import WebServer
@@ -49,6 +51,8 @@ def _ArgumentParser():
common_job_parser.add_argument('--job', required=True,
help='JSON file with job description.')
+ orchestra_parser = task_manager.CommandLineParser()
+
# Plumbing parser to configure OPTIONS.
plumbing_parser = OPTIONS.GetParentParser('plumbing options')
@@ -166,6 +170,19 @@ def _ArgumentParser():
record_trace_parser.add_argument('-o', '--output', type=str, required=True,
help='Output path of the generated trace.')
+ # Run all subcommand.
+ run_all = subparsers.add_parser('run-all',
+ parents=[common_job_parser, orchestra_parser],
+ help='Run the sandwich orchestra.')
pasko 2016/04/11 14:54:08 'Run all steps using the task manager infrastructu
gabadie 2016/04/13 09:53:44 Done.
+ run_all.add_argument('-g', '--gen-full', action='store_true',
+ help='Generate the full orchestra.')
pasko 2016/04/11 14:54:08 there is no more orchestra. For now we can say: 'G
gabadie 2016/04/13 09:53:44 Done.
+ run_all.add_argument('--wpr-archive', default=None, type=str,
+ dest='wpr_archive_path',
+ help='Web page replay archive to load job\'s urls '
pasko 2016/04/11 14:54:08 help='WebPageReplay archive to use, instead of gen
gabadie 2016/04/13 09:53:44 Done.
+ 'from.')
+ run_all.add_argument('--url-repeat', default=1, type=int,
+ help='How many times to repeat the urls.')
+
return parser
@@ -244,6 +261,39 @@ def _RecordWebServerTestTrace(args):
return 0
+def _RunAllMain(args):
+ runner_modifiers = {
+ '2g': sandwich_tasks.EmulateNetworkModifier('Regular2G'),
pasko 2016/04/11 14:54:08 Let's rename it to something like NetworkSimulatio
gabadie 2016/04/13 09:53:44 Done.
+ '3g': sandwich_tasks.EmulateNetworkModifier('Regular3G'),
+ '4g': sandwich_tasks.EmulateNetworkModifier('Regular4G')
+ }
+
+ builder = sandwich_tasks.SandwichTaskBuilder(
+ output_directory=args.output,
+ job_path=args.job,
+ url_repeat=args.url_repeat)
+ if args.wpr_archive_path:
+ builder.SetOriginalWprPath(args.wpr_archive_path)
+ else:
+ builder.PopulateWPRRecordingTask()
+ builder.PopulateCommonPipelines()
+ builder.PopulateFullCacheLoadBenchmark()
+ builder.PopulateClearCacheLoadBenchmark()
+ builder.PopulateNoStatePrefetchLoadBenchmark()
+
+ if args.gen_full:
+ for key, runner_modifier in runner_modifiers.iteritems():
+ builder.PopulateClearCacheLoadBenchmark(
+ benchmark_name='clearcache-' + key,
+ runner_modifier=runner_modifier)
+ builder.PopulateNoStatePrefetchLoadBenchmark(
+ benchmark_name='prefetch-' + key,
+ runner_modifier=runner_modifier)
+
+ return task_manager.ExecuteWithCommandLine(
+ args, builder.tasks.values(), builder.default_final_tasks)
+
+
def main(command_line_args):
logging.basicConfig(level=logging.INFO)
devil_chromium.Initialize()
@@ -266,6 +316,8 @@ def main(command_line_args):
return _FilterCacheMain(args)
if args.subcommand == 'record-test-trace':
return _RecordWebServerTestTrace(args)
+ if args.subcommand == 'run-all':
+ return _RunAllMain(args)
assert False
« no previous file with comments | « no previous file | tools/android/loading/sandwich_misc.py » ('j') | tools/android/loading/sandwich_tasks.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698