Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: NullHypothesis/onionperf
base: master
head repository: NullHypothesis/onionperf
compare: defect/29369
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 comments
  • 1 contributor
Commits on May 29, 2020
The switch tells OnionPerf to prepend today's date to the analysis
output file.  This new switch is mutually exclusive with --date-filter.

This fixes <https://bugs.torproject.org/29369>.
Showing with 14 additions and 2 deletions.
  1. +14 −2 onionperf/onionperf
@@ -261,12 +261,18 @@ files generated by this script will be written""",
action="store", dest="nickname",
default=None)

analyze_parser.add_argument('-d', '--date-filter',
date_group = analyze_parser.add_mutually_exclusive_group()
date_group.add_argument('-d', '--date-filter',
help="""a DATE string in the form YYYY-MM-DD, all log messages that did not occur on this date will be filtered out of the analysis""",
metavar="DATE", type=type_str_date_in,
action="store", dest="date_filter",
default=None)

date_group.add_argument('-x', '--date-prefix',
help="""add a date prefix of the form YYYY-MM-DD- to the output file""",
action="store_true", dest="date_prefix",
default=False)

analyze_parser.add_argument('-s', '--do-simple-parse',
help="""parse and export only summary statistics rather than full transfer/circuit/stream data""",
action="store_true", dest="do_simple",
@@ -365,7 +371,13 @@ def analyze(args):
if args.torctl_logpath is not None:
analysis.add_torctl_file(args.torctl_logpath)
analysis.analyze(args.do_simple, date_filter=args.date_filter)
analysis.save(output_prefix=args.prefix)

filename = None
if args.date_prefix:
n = datetime.datetime.utcnow()
filename = "{}-onionperf.analysis.json.xz".format(n.strftime("%Y-%m-%d"))

analysis.save(filename=filename, output_prefix=args.prefix)

elif args.tgen_logpath is not None and os.path.isdir(args.tgen_logpath) and args.torctl_logpath is not None and os.path.isdir(args.torctl_logpath):
from onionperf import reprocessing

No commit comments for this range