make run-benchmarks.py work (with no args)

This commit is contained in:
Noah Levitt 2018-01-15 17:15:36 -08:00
parent e44d6a88fb
commit 6ab73764ea
2 changed files with 7 additions and 5 deletions

View File

@ -215,9 +215,9 @@ if __name__ == '__main__':
args.cacert = os.path.join(tmpdir, 'benchmark-warcprox-ca.pem')
args.certs_dir = os.path.join(tmpdir, 'benchmark-warcprox-ca')
args.directory = os.path.join(tmpdir, 'warcs')
if args.rethinkdb_servers:
args.rethinkdb_db = 'benchmarks_{:%Y%m%d%H%M%S}' % (
datetime.datetime.utcnow())
# if args.rethinkdb_servers:
# args.rethinkdb_db = 'benchmarks_{:%Y%m%d%H%M%S}' % (
# datetime.datetime.utcnow())
start_servers()
logging.info(
@ -247,7 +247,9 @@ if __name__ == '__main__':
logging.info('SKIPPED')
logging.info('===== baseline benchmark finished =====')
warcprox_controller = warcprox.main.init_controller(args)
options = warcprox.Options(**vars(args))
warcprox_controller = warcprox.controller.WarcproxController(options)
warcprox_controller_thread = threading.Thread(
target=warcprox_controller.run_until_shutdown)
warcprox_controller_thread.start()

View File

@ -61,7 +61,7 @@ class BetterArgumentDefaultsHelpFormatter(
else:
return argparse.ArgumentDefaultsHelpFormatter._get_help_string(self, action)
def _build_arg_parser(prog):
def _build_arg_parser(prog='warcprox'):
arg_parser = argparse.ArgumentParser(prog=prog,
description='warcprox - WARC writing MITM HTTP/S proxy',
formatter_class=BetterArgumentDefaultsHelpFormatter)