Parse the command line arguments.
()
| 328 | |
| 329 | |
| 330 | def parse_args(): |
| 331 | ''' Parse the command line arguments. |
| 332 | ''' |
| 333 | parser = argparse.ArgumentParser(description=description) |
| 334 | |
| 335 | parser.add_argument( |
| 336 | "in_dir", |
| 337 | type=str, |
| 338 | help='''The input directory of traffic_dump replay |
| 339 | files. The expectation is that this will contain |
| 340 | sub-directories that themselves contain replay files. |
| 341 | This is written to accommodate the directory populated |
| 342 | by traffic_dump via the --logdir option.''') |
| 343 | parser.add_argument("out_dir", type=str, help="The output directory of post processed replay files.") |
| 344 | parser.add_argument( |
| 345 | "-n", |
| 346 | "--num_sessions", |
| 347 | type=int, |
| 348 | default=10, |
| 349 | help='''The maximum number of sessions merged into |
| 350 | single replay output files. The default is 10.''') |
| 351 | parser.add_argument( |
| 352 | "--no-human-readable", |
| 353 | action="store_true", |
| 354 | help='''By default, post processor will generate replay |
| 355 | files that are spaced out in a human readable format. |
| 356 | This turns off that behavior and leaves the files as |
| 357 | single-line entries.''') |
| 358 | parser.add_argument( |
| 359 | "--no-fabricate-proxy-requests", |
| 360 | action="store_true", |
| 361 | help='''By default, post processor will fabricate proxy |
| 362 | requests and server responses for transactions served |
| 363 | out of the proxy. Presumably in replay conditions, |
| 364 | these fabricated requests and responses will not hurt |
| 365 | anything because the Proxy Verifier server will not |
| 366 | notice if the proxy replies locally in replay |
| 367 | conditions. However, if it doesn't reply locally, then |
| 368 | the server will not know how to reply to these |
| 369 | requests. Using this option turns off this fabrication |
| 370 | behavior.''') |
| 371 | parser.add_argument("-j", "--num_threads", type=int, default=32, help='''The maximum number of threads to use.''') |
| 372 | parser.add_argument("-d", "--debug", action="store_true", help="Enable debug level logging.") |
| 373 | return parser.parse_args() |
| 374 | |
| 375 | |
| 376 | def main(): |