-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This adds 10MiB downloads hack to tornettools [Discussion] #73
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,7 @@ def __plot_tornet(args): | |
__plot_transfer_time(args, circuittype, torperf_dbs, tornet_dbs, "51200") | ||
__plot_transfer_time(args, circuittype, torperf_dbs, tornet_dbs, "1048576") | ||
__plot_transfer_time(args, circuittype, torperf_dbs, tornet_dbs, "5242880") | ||
__plot_transfer_time(args, circuittype, torperf_dbs, tornet_dbs, "10485760") | ||
|
||
logging.info(f"Loading {circuittype} tornet goodput data") | ||
tornet_dbs = __load_tornet_datasets(args, __pattern_for_basename(circuittype, 'perfclient_goodput')) | ||
|
@@ -88,6 +89,11 @@ def __plot_tornet(args): | |
logging.info(f"Plotting {circuittype} client goodput [5 MiB]") | ||
__plot_client_goodput_5MiB(args, circuittype, torperf_dbs, tornet_dbs) | ||
|
||
logging.info(f"Loading {circuittype} tornet goodput data 10MiB") | ||
tornet_dbs = __load_tornet_datasets(args, __pattern_for_basename(circuittype, 'perfclient_goodput_10MiB')) | ||
logging.info(f"Plotting {circuittype} client goodput [10 MiB]") | ||
__plot_client_goodput_10MiB(args, circuittype, torperf_dbs, tornet_dbs) | ||
|
||
logging.info(f"Loading {circuittype} tornet transfer error rate data") | ||
tornet_dbs = __load_tornet_datasets(args, __pattern_for_basename(circuittype, 'error_rate')) | ||
logging.info(f"Plotting {circuittype} transfer error rates") | ||
|
@@ -236,8 +242,13 @@ def __plot_transfer_time(args, circuittype, torperf_dbs, tornet_dbs, bytes_key): | |
# cache the corresponding data in the 'data' keyword for __plot_cdf_figure | ||
for tornet_db in tornet_dbs: | ||
tornet_db['data'] = [tornet_db['dataset'][i][bytes_key] for i, _ in enumerate(tornet_db['dataset']) if bytes_key in tornet_db['dataset'][i]] | ||
# We do not have public Tor data about 10MiB downloads but we are still | ||
# interested in calculatin the transfer times for the simulated network | ||
for torperf_db in torperf_dbs: | ||
torperf_db['data'] = [torperf_db['dataset']['download_times'][bytes_key]] | ||
if int(bytes_key) <= 5242880: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok for a one-off, but if the aim was to merge this we'd probably want to avoid hard coding this constant here, and instead just make this generally handle a size missing from the public data. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought the idea was not to merge this like this. Should I refactor this so that it can be merged? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's fine do this as a one-off, was just double checking. It'd be helpful to add a note to the PR description that this PR is for discussion purposes and isn't actually a request to merge |
||
torperf_db['data'] = [torperf_db['dataset']['download_times'][bytes_key]] | ||
else: | ||
torperf_db['data'] = [] | ||
|
||
dbs_to_plot = torperf_dbs + tornet_dbs | ||
|
||
|
@@ -310,6 +321,29 @@ def __plot_client_goodput_5MiB(args, circuittype, torperf_dbs, tornet_dbs): | |
yscale="taillog", | ||
xlabel=f"{circuittype} Client Transfer Goodput (Mbit/s): 4 to 5 MiB") | ||
|
||
def __plot_client_goodput_10MiB(args, circuittype, torperf_dbs, tornet_dbs): | ||
if circuittype == 'onionservice': | ||
# TODO: parse and split onionservice data | ||
torperf_dbs = [] | ||
|
||
# Computes throughput for last of 10MiB transfer | ||
|
||
# cache the corresponding data in the 'data' keyword for __plot_cdf_figure | ||
for tornet_db in tornet_dbs: | ||
# For compatibility with legacy parsed data, the output of the parse | ||
# step is in *mebi* bits per second. Convert to *mega* here. | ||
tornet_db['data'] = [[x * 2**20 / 1e6 for x in ds] for ds in tornet_db['dataset']] | ||
|
||
# We do not have public Tor data about 10 MiB downloads | ||
for torperf_db in torperf_dbs: | ||
torperf_db['data'] = [] | ||
|
||
dbs_to_plot = torperf_dbs + tornet_dbs | ||
|
||
__plot_cdf_figure(args, dbs_to_plot, f'client_goodput_10MiB.{circuittype}', | ||
yscale="taillog", | ||
xlabel=f"{circuittype} Client Transfer Goodput (Mbit/s): 9 to 10 MiB") | ||
|
||
def __plot_cdf_figure(args, dbs, filename, xscale=None, yscale=None, xlabel=None, ylabel="CDF"): | ||
color_cycle = cycle(DEFAULT_COLORS) | ||
linestyle_cycle = cycle(DEFAULT_LINESTYLES) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I think this isn't going to find anything since this code is parsing the public tor data, which doesn't have 10 MB downloads. (It shouldn't hurt anything either, though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes did mentioned it above: "Please not that I have added the option to parse the same download size from onionperf. This is not needed at this point since we do not have onionperf clients producing these tests. I have mainly added this for consistency and in case we might consider having a few onionperf clients producing these test in the not so far future."