From 7a38efad2582d57f915fa2501517b7c26cc0e850 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 13 Jan 2020 16:48:35 +0000 Subject: [PATCH 01/16] Update scripts --- scripts/Makefile | 233 +++++++++++++++++++++++++++++++++++++++++++ scripts/fastprobe.py | 4 +- scripts/run-3 | 2 +- 3 files changed, 237 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index c92c28a..96ad138 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -455,3 +455,236 @@ lightning-guards: tor2 -f /etc/torrc_guard_9, \ tor2 -f /etc/torrc_guard_11, \ tor2 -f /etc/torrc_simple. + + +jan_tor_analysis: + ./run-3 \ + 8,tor_analysis. \ + orig-client 135000 40 172, \ + orig-client 113400 48 172, \ + orig-client 91800 59 172, \ + orig-client 70800 77 172, \ + orig-client 48600 111 172, \ + orig-client 27000 200 172, \ + orig-client 5400 1000 172, \ + orig-client 135000 40 172, \ + orig-client 113400 48 172, \ + orig-client 91800 59 172, \ + orig-client 70800 77 172, \ + orig-client 48600 111 172, \ + orig-client 27000 200 172, \ + orig-client 5400 1000 172, \ + orig-client 135000 40 172, \ + orig-client 113400 48 172, \ + orig-client 91800 59 172, \ + orig-client 70800 77 172, \ + orig-client 48600 111 172, \ + orig-client 27000 200 172, \ + orig-client 5400 1000 172, \ + orig-client 135000 40 172, \ + orig-client 113400 48 172, \ + orig-client 91800 59 172, \ + orig-client 70800 77 172, \ + orig-client 48600 111 172, \ + orig-client 27000 200 172, \ + orig-client 5400 1000 172, \ + orig-client 135000 40 172, \ + orig-client 113400 48 172, \ + orig-client 91800 59 172, \ + orig-client 70800 77 172, \ + orig-client 48600 111 172, \ + orig-client 27000 200 172, \ + orig-client 5400 1000 172, \ + orig-client 135000 40 172, \ + orig-client 113400 48 172, \ + orig-client 91800 59 172, \ + orig-client 70800 77 172, \ + orig-client 48600 111 172, \ + orig-client 27000 200 172, \ + orig-client 5400 1000 172, \ + orig-client 135000 40 172, \ + orig-client 113400 48 172, \ + orig-client 91800 59 172, \ + orig-client 70800 77 172, \ + orig-client 48600 111 172, \ + orig-client 27000 200 172, \ + orig-client 5400 1000 172, \ + orig-client 135000 40 172, \ + orig-client 113400 48 172, \ + orig-client 91800 59 172, \ + orig-client 70800 77 172, \ + orig-client 48600 111 172, \ + orig-client 27000 200 172, \ + orig-client 5400 1000 172. \ + \ + orig-server 135000 40 172, \ + orig-server 113400 48 172, \ + orig-server 91800 59 172, \ + orig-server 70800 77 172, \ + orig-server 48600 111 172, \ + orig-server 27000 200 172, \ + orig-server 5400 1000 172, \ + orig-server 135000 40 172, \ + orig-server 113400 48 172, \ + orig-server 91800 59 172, \ + orig-server 70800 77 172, \ + orig-server 48600 111 172, \ + orig-server 27000 200 172, \ + orig-server 5400 1000 172, \ + orig-server 135000 40 172, \ + orig-server 113400 48 172, \ + orig-server 91800 59 172, \ + orig-server 70800 77 172, \ + orig-server 48600 111 172, \ + orig-server 27000 200 172, \ + orig-server 5400 1000 172, \ + orig-server 135000 40 172, \ + orig-server 113400 48 172, \ + orig-server 91800 59 172, \ + orig-server 70800 77 172, \ + orig-server 48600 111 172, \ + orig-server 27000 200 172, \ + orig-server 5400 1000 172, \ + orig-server 135000 40 172, \ + orig-server 113400 48 172, \ + orig-server 91800 59 172, \ + orig-server 70800 77 172, \ + orig-server 48600 111 172, \ + orig-server 27000 200 172, \ + orig-server 5400 1000 172, \ + orig-server 135000 40 172, \ + orig-server 113400 48 172, \ + orig-server 91800 59 172, \ + orig-server 70800 77 172, \ + orig-server 48600 111 172, \ + orig-server 27000 200 172, \ + orig-server 5400 1000 172, \ + orig-server 135000 40 172, \ + orig-server 113400 48 172, \ + orig-server 91800 59 172, \ + orig-server 70800 77 172, \ + orig-server 48600 111 172, \ + orig-server 27000 200 172, \ + orig-server 5400 1000 172, \ + orig-server 135000 40 172, \ + orig-server 113400 48 172, \ + orig-server 91800 59 172, \ + orig-server 70800 77 172, \ + orig-server 48600 111 172, \ + orig-server 27000 200 172, \ + orig-server 5400 1000 172. \ + \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1. \ + \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1, \ + tor3 -f /etc/torrc_guard_1. + diff --git a/scripts/fastprobe.py b/scripts/fastprobe.py index 64a3ce0..14a4bfe 100755 --- a/scripts/fastprobe.py +++ b/scripts/fastprobe.py @@ -7,6 +7,7 @@ groupmap = {"0": "fast", "1": "probe"} redmap = {"1": "orig", "0": "pad"} res = {} seen = set() +vals = 0 for line in sys.stdin: if "~ measlat ~" in line: @@ -20,8 +21,9 @@ for line in sys.stdin: red = redmap[m[5]] if (group, red) not in res: res[(group,red)] = 0 res[(group,red)] += 1 + vals += 1 print("group,redundancy,count") for key,val in res.items(): g,r = key - print(f"{g},{r},{val}") + print(f"{g},{r},{val/vals}") diff --git a/scripts/run-3 b/scripts/run-3 index 0daa6af..5bab8cc 100755 --- a/scripts/run-3 +++ b/scripts/run-3 @@ -5,7 +5,7 @@ die() { echo "$*" 1>&2 ; exit 1; } -WAITFOR=1200 # 15min +WAITFOR=7200 # 2 hours # SPLIT CLIENT AND SERVER TARGETS OLD_IFS=$IFS; IFS="." From ef26caaf57ccb4d3dbd7c31c8b9c525002ff53e7 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 13 Jan 2020 17:01:57 +0000 Subject: [PATCH 02/16] WIP parser script --- scripts/jantoran.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 scripts/jantoran.py diff --git a/scripts/jantoran.py b/scripts/jantoran.py new file mode 100755 index 0000000..853e17e --- /dev/null +++ b/scripts/jantoran.py @@ -0,0 +1,12 @@ +#!/usr/bin/python3 +import os,sys + +def parse_folder(p): + with open(p + '/info.txt') as f: + print(f.readlines()) + +def parse_out(p): + for folder in os.listdir(p): + parse_folder(p + '/' + folder) + +parse_out(sys.argv[1]) From 5ebbfcd6e39a528caf06f8681a8958d58ea8838b Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 14 Jan 2020 11:09:52 +0000 Subject: [PATCH 03/16] Generate files --- scripts/jantoran.py | 61 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/scripts/jantoran.py b/scripts/jantoran.py index 853e17e..1c27e16 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -1,12 +1,59 @@ #!/usr/bin/python3 -import os,sys +import os,sys,re,functools -def parse_folder(p): - with open(p + '/info.txt') as f: - print(f.readlines()) +def compute_failure(s): + it = s['current']['interval'] + if it not in s['failure']: s['failure'][it] = [] + s['failure'][it].append(round(s['current']['max_pkt'] * s['current']['interval'] / 1000 / 60)) -def parse_out(p): +def extract_measlat(log, s): + with open(log) as f: + for l in f: + x = re.search(r'Packet (\d+) latency (\d+)µs with', l) + if x: + s['current']['max_pkt'] = int(x.groups()[0]) + +def extract_info(inf, s): + with open(inf) as f: + full = ''.join(f.readlines()) + x = re.search(r'orig-server (\d+) (\d+) \d+', full) + s['current']['npkt'] = int(x.groups()[0]) + s['current']['interval'] = int(x.groups()[1]) + +def extract_folder(p, s): + extract_info(p + '/info.txt', s) + extract_measlat(p + '/log/client-measlat-stdout.log', s) + + compute_failure(s) + +def extract(p, s): + item_count = functools.reduce(lambda acc, prev: acc + 1, os.listdir(p), 0) + + counter = 0 + print("extracting...") for folder in os.listdir(p): - parse_folder(p + '/' + folder) + s['current'] = {} + extract_folder(p + '/' + folder, s) + s[folder] = s['current'] + counter += 1 + progress = round(counter / item_count * 100) + print(f"{progress}%", end="\r") + print("done") -parse_out(sys.argv[1]) +def analyze_failure(s): + print(f"rate,duration") + for k, v in s['failure'].items(): + rate = round(1000 / k) + for e in v: + print(f"{rate},{e}") + +def analyze(s): + print("analyzing...") + analyze_failure(s) + +state = {'failure': {}} +extract(sys.argv[1], state) +analyze(state) + +#for key, value in state.items(): +# print(value) From e11c72ed7a3fb2216bd16538841462aa84fcb70b Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 14 Jan 2020 14:32:20 +0000 Subject: [PATCH 04/16] Don't use ggplot ECDF --- scripts/jantoran.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/jantoran.py b/scripts/jantoran.py index 1c27e16..529d3ad 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -41,11 +41,15 @@ def extract(p, s): print("done") def analyze_failure(s): - print(f"rate,duration") - for k, v in s['failure'].items(): - rate = round(1000 / k) - for e in v: - print(f"{rate},{e}") + with open('jan_failure.csv', 'w') as f: + f.write(f"rate,duration,ecdf\n") + for k, v in s['failure'].items(): + v = sorted(v) + total = len(v) + rate = round(1000 / k) + for idx,e in enumerate(v,start=1): + if e == 90: break + f.write(f"{rate},{e},{idx/total}\n") def analyze(s): print("analyzing...") From 77bf1806346954305870c5984104789fbf0dae9c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 14 Jan 2020 17:16:34 +0000 Subject: [PATCH 05/16] Nice plot --- scripts/jantoran.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/jantoran.py b/scripts/jantoran.py index 529d3ad..eeb4f0c 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -47,9 +47,14 @@ def analyze_failure(s): v = sorted(v) total = len(v) rate = round(1000 / k) + score = 0 + f.write(f"{rate},0,0\n") for idx,e in enumerate(v,start=1): - if e == 90: break - f.write(f"{rate},{e},{idx/total}\n") + if e >= 90: + f.write(f"{rate},90,{score}\n") + break + score = idx/total + f.write(f"{rate},{e},{score}\n") def analyze(s): print("analyzing...") From 61213dbab01d2c3d446e7ce00d9e51ef289a3bdd Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 16 Jan 2020 16:59:29 +0000 Subject: [PATCH 06/16] WIP script --- scripts/jantoran.py | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/scripts/jantoran.py b/scripts/jantoran.py index eeb4f0c..8d1dbc9 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -6,12 +6,28 @@ def compute_failure(s): if it not in s['failure']: s['failure'][it] = [] s['failure'][it].append(round(s['current']['max_pkt'] * s['current']['interval'] / 1000 / 60)) +def compute_circuit_distri(s): + s['current']['lats'] = l = sorted(s['current']['lats']) + s['current']['distri'] = d = {} + perc = lambda p: l[round(p * (len(l) - 1))] + for x in [0, 0.25, 0.5, 0.75, 0.99, 0.999, 1]: + d[str(x)] = perc(x) + +def compute_interval_distri(s): + for inter, val in s['per_interval']: + s['per_interval_res'][inter] = {} + s['per_interval_res'][inter]['agg'] = sorted([].extend([ elem['lats'] for elem in val])) + def extract_measlat(log, s): + s['current']['max_pkt'] = 0 + s['current']['lats'] = [] with open(log) as f: for l in f: x = re.search(r'Packet (\d+) latency (\d+)µs with', l) if x: - s['current']['max_pkt'] = int(x.groups()[0]) + lat = x.groups()[0] + s['current']['max_pkt'] = max(s['current']['max_pkt'], int(lat)) + s['current']['lats'].append(lat) def extract_info(inf, s): with open(inf) as f: @@ -25,6 +41,14 @@ def extract_folder(p, s): extract_measlat(p + '/log/client-measlat-stdout.log', s) compute_failure(s) + compute_circuit_distri(s) if s['current']['interval'] == 40 + +def categorize(folder, s): + s[folder] = s['current'] + + i = s['current']['interval'] + if i not in s['per_interval']: s['per_interval'][i] = [] + s['per_interval'][i].append(current) def extract(p, s): item_count = functools.reduce(lambda acc, prev: acc + 1, os.listdir(p), 0) @@ -34,12 +58,16 @@ def extract(p, s): for folder in os.listdir(p): s['current'] = {} extract_folder(p + '/' + folder, s) - s[folder] = s['current'] + categorize(folder, s) counter += 1 progress = round(counter / item_count * 100) print(f"{progress}%", end="\r") print("done") +def compute_global(s): + print("computing global...") + compute_interval_distri(s) + def analyze_failure(s): with open('jan_failure.csv', 'w') as f: f.write(f"rate,duration,ecdf\n") @@ -60,8 +88,9 @@ def analyze(s): print("analyzing...") analyze_failure(s) -state = {'failure': {}} + state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}} extract(sys.argv[1], state) +compute_global(state) analyze(state) #for key, value in state.items(): From aa32e6d1fe173fb652bbfdb90298fb6061df7092 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 16 Jan 2020 17:53:29 +0000 Subject: [PATCH 07/16] code does not crash --- scripts/jantoran.py | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/scripts/jantoran.py b/scripts/jantoran.py index 8d1dbc9..a0d5df0 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -1,22 +1,33 @@ #!/usr/bin/python3 import os,sys,re,functools +default_perc = [0, 0.25, 0.5, 0.75, 0.99, 0.999, 1] + +def tool_distri(arr, perc): + r = {} + for p in perc: + r[str(p)] = arr[round(p * (len(arr) - 1))] + return r + def compute_failure(s): it = s['current']['interval'] if it not in s['failure']: s['failure'][it] = [] s['failure'][it].append(round(s['current']['max_pkt'] * s['current']['interval'] / 1000 / 60)) def compute_circuit_distri(s): - s['current']['lats'] = l = sorted(s['current']['lats']) - s['current']['distri'] = d = {} - perc = lambda p: l[round(p * (len(l) - 1))] - for x in [0, 0.25, 0.5, 0.75, 0.99, 0.999, 1]: - d[str(x)] = perc(x) + l = sorted(s['current']['lats']) + s['current']['distri'] = tool_distri(l, default_perc) def compute_interval_distri(s): - for inter, val in s['per_interval']: - s['per_interval_res'][inter] = {} - s['per_interval_res'][inter]['agg'] = sorted([].extend([ elem['lats'] for elem in val])) + print(" + latency distribution for given packet freq.") + to_process = len(s['per_interval']) + processed = 0 + for inter, val in s['per_interval'].items(): + progress = round(processed / to_process * 100) + print(f"{progress}%", end="\r") + x = sorted(functools.reduce(lambda acc, v: acc + v['lats'], val, [])) + s['per_interval_res'][inter] = tool_distri(x, default_perc) + processed += 1 def extract_measlat(log, s): s['current']['max_pkt'] = 0 @@ -41,14 +52,14 @@ def extract_folder(p, s): extract_measlat(p + '/log/client-measlat-stdout.log', s) compute_failure(s) - compute_circuit_distri(s) if s['current']['interval'] == 40 + compute_circuit_distri(s) if s['current']['interval'] == 40 else None def categorize(folder, s): s[folder] = s['current'] - i = s['current']['interval'] + i = str(s['current']['interval']) if i not in s['per_interval']: s['per_interval'][i] = [] - s['per_interval'][i].append(current) + s['per_interval'][i].append(s['current']) def extract(p, s): item_count = functools.reduce(lambda acc, prev: acc + 1, os.listdir(p), 0) @@ -65,7 +76,7 @@ def extract(p, s): print("done") def compute_global(s): - print("computing global...") + print("computing on global values...") compute_interval_distri(s) def analyze_failure(s): @@ -88,7 +99,7 @@ def analyze(s): print("analyzing...") analyze_failure(s) - state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}} +state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}} extract(sys.argv[1], state) compute_global(state) analyze(state) From 3a6a9055d34f7b2cca10cee60461d9a122450f23 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 16 Jan 2020 18:08:04 +0000 Subject: [PATCH 08/16] fix bugs --- scripts/jantoran.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/jantoran.py b/scripts/jantoran.py index a0d5df0..38d03d9 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -25,6 +25,7 @@ def compute_interval_distri(s): for inter, val in s['per_interval'].items(): progress = round(processed / to_process * 100) print(f"{progress}%", end="\r") + #print(val[0]['lats'][0:10]) x = sorted(functools.reduce(lambda acc, v: acc + v['lats'], val, [])) s['per_interval_res'][inter] = tool_distri(x, default_perc) processed += 1 @@ -36,8 +37,9 @@ def extract_measlat(log, s): for l in f: x = re.search(r'Packet (\d+) latency (\d+)µs with', l) if x: - lat = x.groups()[0] - s['current']['max_pkt'] = max(s['current']['max_pkt'], int(lat)) + pkt = int(x.groups()[0]) + lat = int(x.groups()[1]) + s['current']['max_pkt'] = max(s['current']['max_pkt'], pkt) s['current']['lats'].append(lat) def extract_info(inf, s): @@ -95,9 +97,17 @@ def analyze_failure(s): score = idx/total f.write(f"{rate},{e},{score}\n") +def analyze_interval(s): + with open('jan_interval.csv', 'w') as f: + f.write(f"rate,perc,lat\n") + for rate, entr in s['per_interval_res'].items(): + for perc, lat in entr.items(): + f.write(f"{rate},{perc},{lat}\n") + def analyze(s): print("analyzing...") analyze_failure(s) + analyze_interval(s) state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}} extract(sys.argv[1], state) From 11472da4933878a56726a0d11f97907cb4e073d8 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 16 Jan 2020 18:29:24 +0000 Subject: [PATCH 09/16] Generate all files I want --- scripts/jantoran.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/jantoran.py b/scripts/jantoran.py index 38d03d9..5449b21 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -16,7 +16,7 @@ def compute_failure(s): def compute_circuit_distri(s): l = sorted(s['current']['lats']) - s['current']['distri'] = tool_distri(l, default_perc) + s['per_circuit_res'].append(tool_distri(l, default_perc)) def compute_interval_distri(s): print(" + latency distribution for given packet freq.") @@ -104,12 +104,28 @@ def analyze_interval(s): for perc, lat in entr.items(): f.write(f"{rate},{perc},{lat}\n") +def analyze_circuit(s): + a = sorted(s['per_circuit_res'], key=lambda v: v['0.5']) + with open('jan_circuit_median.csv', 'w') as f: + f.write(f"id,perc,lat\n") + for idx,e in enumerate(a,start=1): + for perc, lat in e.items(): + f.write(f"{idx},{perc},{lat}\n") + + a = sorted(s['per_circuit_res'], key=lambda v: v['1']) + with open('jan_circuit_max.csv', 'w') as f: + f.write(f"id,perc,lat\n") + for idx,e in enumerate(a,start=1): + for perc, lat in e.items(): + f.write(f"{idx},{perc},{lat}\n") + def analyze(s): print("analyzing...") analyze_failure(s) analyze_interval(s) + analyze_circuit(s) -state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}} +state = {'failure': {}, 'per_interval': {}, 'per_interval_res': {}, 'per_circuit_res': []} extract(sys.argv[1], state) compute_global(state) analyze(state) From 037dbb0a91e89b653076d84807a48ba0899041fe Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 17 Jan 2020 17:07:03 +0000 Subject: [PATCH 10/16] WIP jan battle --- scripts/Makefile | 65 +++++++++++++++++++++++++++++++++++++++++++++ scripts/jantoran.py | 9 ++++--- 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 1a36669..3040ad4 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -688,3 +688,68 @@ jan_tor_analysis: tor3 -f /etc/torrc_guard_1, \ tor3 -f /etc/torrc_guard_1. +jan_battle: + ./run-3 \ + 64,battle. \ + orig-client 7500 40 172, \ + orig-client 7500 40 172, \ + orig-client 7500 40 172, \ + dup2-client 7500 40 172 2, \ + dup2-client 7500 40 172 2, \ + dup2-client 7500 40 172 2, \ + lightning-client 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ + lightning-client 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ + lightning-client 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ + lightning-client 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + orig-server-single 7500 40 172, \ + orig-server 7500 40 172, \ + orig-server 7500 40 172, \ + dup2-server-single 7500 40 172 2, \ + dup2-server 7500 40 172 2, \ + dup2-server 7500 40 172 2, \ + lightning-server-single 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ + lightning-server 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ + lightning-server 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ + lightning-server-single 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2. \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor3 -f /etc/torrc_guard_2. + + diff --git a/scripts/jantoran.py b/scripts/jantoran.py index 5449b21..df30f35 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -100,9 +100,10 @@ def analyze_failure(s): def analyze_interval(s): with open('jan_interval.csv', 'w') as f: f.write(f"rate,perc,lat\n") - for rate, entr in s['per_interval_res'].items(): + for inter, entr in s['per_interval_res'].items(): + rate = round(1000 / int(inter)) for perc, lat in entr.items(): - f.write(f"{rate},{perc},{lat}\n") + f.write(f"{rate},{float(perc)*100}%,{lat/1000}\n") def analyze_circuit(s): a = sorted(s['per_circuit_res'], key=lambda v: v['0.5']) @@ -110,14 +111,14 @@ def analyze_circuit(s): f.write(f"id,perc,lat\n") for idx,e in enumerate(a,start=1): for perc, lat in e.items(): - f.write(f"{idx},{perc},{lat}\n") + f.write(f"{idx},{float(perc)*100}%,{lat/1000}\n") a = sorted(s['per_circuit_res'], key=lambda v: v['1']) with open('jan_circuit_max.csv', 'w') as f: f.write(f"id,perc,lat\n") for idx,e in enumerate(a,start=1): for perc, lat in e.items(): - f.write(f"{idx},{perc},{lat}\n") + f.write(f"{idx},{float(perc)*100}%,{lat/1000}\n") def analyze(s): print("analyzing...") From 9c9985cb60f9072e4504a30b347b1066f61e5679 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sat, 18 Jan 2020 17:41:53 +0000 Subject: [PATCH 11/16] Rerun XP --- scripts/Makefile | 165 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 116 insertions(+), 49 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 3040ad4..6218079 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -688,68 +688,135 @@ jan_tor_analysis: tor3 -f /etc/torrc_guard_1, \ tor3 -f /etc/torrc_guard_1. -jan_battle: +jan_battle_normal: ./run-3 \ - 64,battle. \ - orig-client 7500 40 172, \ - orig-client 7500 40 172, \ - orig-client 7500 40 172, \ - dup2-client 7500 40 172 2, \ - dup2-client 7500 40 172 2, \ - dup2-client 7500 40 172 2, \ - lightning-client 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ - lightning-client 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ - lightning-client 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ - lightning-client 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ - orig-server-single 7500 40 172, \ - orig-server 7500 40 172, \ - orig-server 7500 40 172, \ - dup2-server-single 7500 40 172 2, \ - dup2-server 7500 40 172 2, \ - dup2-server 7500 40 172 2, \ - lightning-server-single 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ - lightning-server 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ - lightning-server 7500 40 172 12 disable_scheduler=1!fast_count=8!tick_tock=1!measlat=1!window=300000, \ - lightning-server-single 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 7500 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server 7500 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + 8,battle. \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ tor2 -f /etc/torrc_guard_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2, \ tor2 -f /etc/torrc_guard_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2, \ tor2 -f /etc/torrc_guard_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2, \ tor2 -f /etc/torrc_guard_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2, \ tor2 -f /etc/torrc_guard_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2. \ - tor2 -f /etc/torrc_single_hop_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2, \ - tor2 -f /etc/torrc_single_hop_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2, \ - tor2 -f /etc/torrc_single_hop_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2, \ - tor2 -f /etc/torrc_single_hop_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2, \ - tor2 -f /etc/torrc_single_hop_16, \ tor2 -f /etc/torrc_guard_16, \ - tor3 -f /etc/torrc_guard_2. - - + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16. \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16. + From 4027b8ef75040310385d40befaa8c8408d3ccf30 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sat, 18 Jan 2020 19:48:38 +0000 Subject: [PATCH 12/16] add 2 other strategies --- scripts/Makefile | 267 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 266 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile b/scripts/Makefile index 6218079..77c7c4e 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -819,4 +819,269 @@ jan_battle_normal: tor2 -f /etc/torrc_guard_16, \ tor2 -f /etc/torrc_guard_16, \ tor2 -f /etc/torrc_guard_16. - + +jan_battle_hardened: + ./run-3 \ + 8,jan_battle_hardened. \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + orig-server 135000 40 172, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + dup2-server 135000 40 172 2, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2. \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2. + +jan_battle_light: + ./run-3 \ + 8,jan_battle_light. \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16, \ + tor2 -f /etc/torrc_guard_16. \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16, \ + tor2 -f /etc/torrc_single_hop_16. + + From a3c41400ec7098970f219554d7a0ac4a3711f2c8 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sun, 19 Jan 2020 19:43:02 +0000 Subject: [PATCH 13/16] Add prefix to run multiple xp in parallel --- scripts/run-3 | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/scripts/run-3 b/scripts/run-3 index 5bab8cc..f7dd03b 100755 --- a/scripts/run-3 +++ b/scripts/run-3 @@ -5,6 +5,7 @@ die() { echo "$*" 1>&2 ; exit 1; } +DOCKNAME=`mktemp -u XXXXX` WAITFOR=7200 # 2 hours # SPLIT CLIENT AND SERVER TARGETS @@ -54,14 +55,14 @@ echo "__reset containers" for i in $(seq 0 $(expr $instances - 1)); do echo "____clear $i" - docker container inspect donarxp_server_${i} > /dev/null 2>&1 && docker kill donarxp_server_${i} - docker container inspect donarxp_client_${i} > /dev/null 2>&1 && docker kill donarxp_client_${i} + docker container inspect ${DOCKNAME}_donarxp_server_${i} > /dev/null 2>&1 && docker kill ${DOCKNAME}_donarxp_server_${i} + docker container inspect ${DOCKNAME}_donarxp_client_${i} > /dev/null 2>&1 && docker kill ${DOCKNAME}_donarxp_client_${i} echo "____spawning container for instance=$i..." docker run \ --rm \ -d \ - --name "donarxp_server_${i}" \ + --name "${DOCKNAME}_donarxp_server_${i}" \ --privileged \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ @@ -76,15 +77,15 @@ for i in $(seq 0 $(expr $instances - 1)); do --privileged \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ - --name "donarxp_client_${i}" \ + --name "${DOCKNAME}_donarxp_client_${i}" \ -e HOME='/tmp' \ -v `pwd`/out:/home/donar/out \ registry.gitlab.inria.fr/qdufour/donar \ ${TOR_DAEMON_CLIENT[$i]} echo "____create folder struct..." - docker exec donarxp_client_${i} sh -c "mkdir -p $run_fold-$i; echo repeat=$REPEAT,identifier=$IDENTIFIER > $run_fold-$i/info.txt" - docker exec donarxp_client_${i} sh -c "echo instance=$i - server=${SERVER_TARGETS[$i]} - client=${CLIENT_TARGETS[$i]} - tor server=${TOR_DAEMON_SERVER[$i]} - tor client=${TOR_DAEMON_CLIENT[$i]}>> $run_fold-$i/info.txt" + docker exec ${DOCKNAME}_donarxp_client_${i} sh -c "mkdir -p $run_fold-$i; echo repeat=$REPEAT,identifier=$IDENTIFIER > $run_fold-$i/info.txt" + docker exec ${DOCKNAME}_donarxp_client_${i} sh -c "echo instance=$i - server=${SERVER_TARGETS[$i]} - client=${CLIENT_TARGETS[$i]} - tor server=${TOR_DAEMON_SERVER[$i]} - tor client=${TOR_DAEMON_CLIENT[$i]}>> $run_fold-$i/info.txt" done sleep 10 @@ -92,7 +93,7 @@ sleep 10 echo "__launch servers" for i in $(seq 0 $(expr $instances - 1)); do echo " instance=$i - exec=${SERVER_TARGETS[$i]}" - docker exec donarxp_server_$i ${SERVER_TARGETS[$i]} ${run_fold}-$i & + docker exec ${DOCKNAME}_donarxp_server_$i ${SERVER_TARGETS[$i]} ${run_fold}-$i & sleep 1 done @@ -103,15 +104,15 @@ echo "__launch clients" (sleep $WAITFOR; echo " timeout"; kill -9 $subshellpid) & (for i in $(seq 0 $(expr $instances - 1)); do echo " instance=$i - exec=${CLIENT_TARGETS[$i]}" - docker exec donarxp_client_$i ${CLIENT_TARGETS[$i]} ${run_fold}-$i & + docker exec ${DOCKNAME}_donarxp_client_$i ${CLIENT_TARGETS[$i]} ${run_fold}-$i & sleep 1 done; wait; echo " ok"; for i in $(seq 0 $(expr $instances - 1)); do - docker exec donarxp_client_${i} killall -15 donar; - docker exec donarxp_server_${i} killall -15 donar; + docker exec ${DOCKNAME}_donarxp_client_${i} killall -15 donar; + docker exec ${DOCKNAME}_donarxp_server_${i} killall -15 donar; done; kill -15 $subshellpid @@ -124,6 +125,6 @@ done echo ":: Clear Resources" for i in $(seq 0 $(expr $instances - 1)); do echo "clear $i" - docker kill "donarxp_server_${i}" - docker kill "donarxp_client_${i}" + docker kill "${DOCKNAME}_donarxp_server_${i}" + docker kill "${DOCKNAME}_donarxp_client_${i}" done From bfc5c4fc29e91d798504881aaf3ea3330bde4322 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 20 Jan 2020 08:44:37 +0000 Subject: [PATCH 14/16] Improve jantoran --- scripts/jantoran.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/jantoran.py b/scripts/jantoran.py index df30f35..98dbc42 100755 --- a/scripts/jantoran.py +++ b/scripts/jantoran.py @@ -46,11 +46,16 @@ def extract_info(inf, s): with open(inf) as f: full = ''.join(f.readlines()) x = re.search(r'orig-server (\d+) (\d+) \d+', full) - s['current']['npkt'] = int(x.groups()[0]) - s['current']['interval'] = int(x.groups()[1]) + if x: + s['current']['npkt'] = int(x.groups()[0]) + s['current']['interval'] = int(x.groups()[1]) + return True + else: + print("read error for",inf) + return False def extract_folder(p, s): - extract_info(p + '/info.txt', s) + if not extract_info(p + '/info.txt', s): return False extract_measlat(p + '/log/client-measlat-stdout.log', s) compute_failure(s) @@ -70,8 +75,7 @@ def extract(p, s): print("extracting...") for folder in os.listdir(p): s['current'] = {} - extract_folder(p + '/' + folder, s) - categorize(folder, s) + extract_folder(p + '/' + folder, s) and categorize(folder, s) counter += 1 progress = round(counter / item_count * 100) print(f"{progress}%", end="\r") From 2580dee925d245333cb3999af474f3ecdb55ea5a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 20 Jan 2020 10:31:59 +0000 Subject: [PATCH 15/16] Add new parsing file --- scripts/jantoran_2.py | 99 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100755 scripts/jantoran_2.py diff --git a/scripts/jantoran_2.py b/scripts/jantoran_2.py new file mode 100755 index 0000000..04ba26f --- /dev/null +++ b/scripts/jantoran_2.py @@ -0,0 +1,99 @@ +#!/usr/bin/python3 +import os,sys,re,functools + +default_perc = [0, 0.25, 0.5, 0.75, 0.99, 0.999, 1] + +def tool_distri(arr, perc): + r = {} + for p in perc: + r[str(p)] = arr[round(p * (len(arr) - 1))] + return r + +def compute_failure(s): + it = s['current']['strat'] + if it not in s['failure']: s['failure'][it] = [] + s['failure'][it].append(round(s['current']['max_pkt'] * s['current']['interval'] / 1000 / 60)) + return True + +def extract_measlat(log, s): + s['current']['max_pkt'] = 0 + s['current']['lats'] = [] + try: + with open(log) as f: + for l in f: + x = re.search(r'Packet (\d+) latency (\d+)µs with', l) + if x: + pkt = int(x.groups()[0]) + lat = int(x.groups()[1]) + s['current']['max_pkt'] = max(s['current']['max_pkt'], pkt) + #s['current']['lats'].append(lat) + return True + except: + return False + +def extract_info(inf, s): + try: + with open(inf) as f: + full = ''.join(f.readlines()) + x = re.search(r'server= (\S+) (\d+) (\d+) \d+ (\d+ (\S+))?', full) + if x: + s['current']['strat'] = x.groups()[0] + if x.groups()[4] != None: + y = re.search(r'tick_tock=(\d)', x.groups()[4]) + if y: + s['current']['strat'] += "-ticktock" if y.groups()[0] == '1' else "-duplicate" + s['current']['npkt'] = int(x.groups()[1]) + s['current']['interval'] = int(x.groups()[2]) + return True + else: + print("parse error for",inf) + return False + except Exception as e: + print("read error", inf, e) + return False + +def extract_folder(p, s): + return extract_info(p + '/info.txt', s) and extract_measlat(p + '/log/client-measlat-stdout.log', s) and compute_failure(s) + +def categorize(folder, s): + s[folder] = s['current'] + + i = str(s['current']['strat']) + if i not in s['per_strat']: s['per_strat'][i] = [] + s['per_strat'][i].append(s['current']) + +def extract(p, s): + item_count = functools.reduce(lambda acc, prev: acc + 1, os.listdir(p), 0) + + counter = 0 + print("extracting...") + for folder in os.listdir(p): + s['current'] = {} + extract_folder(p + '/' + folder, s) and categorize(folder, s) + counter += 1 + progress = round(counter / item_count * 100) + print(f"{progress}%", end="\r") + print("done") + +def analyze_failure(s): + with open('jan2_failure.csv', 'w') as f: + f.write(f"strat,duration,ecdf\n") + for strat, v in s['failure'].items(): + v = sorted(v) + total = len(v) + score = 0 + f.write(f"{strat},0,0\n") + for idx,e in enumerate(v,start=1): + if e >= 90: + f.write(f"{strat},90,{score}\n") + break + score = idx/total + f.write(f"{strat},{e},{score}\n") + +def analyze(s): + print("analyzing...") + analyze_failure(s) + +state = {'failure': {}, 'per_strat': {}, 'per_interval_res': {}, 'per_circuit_res': []} +extract(sys.argv[1], state) +analyze(state) From 32536b15d4ee069f55550d86ec5308a1d872ba82 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 20 Jan 2020 10:53:55 +0000 Subject: [PATCH 16/16] Improve jantoran2 --- scripts/jantoran_2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/jantoran_2.py b/scripts/jantoran_2.py index 04ba26f..d47ee6d 100755 --- a/scripts/jantoran_2.py +++ b/scripts/jantoran_2.py @@ -35,6 +35,8 @@ def extract_info(inf, s): try: with open(inf) as f: full = ''.join(f.readlines()) + w = re.search(r'identifier=jan_', full) + if not w: return False x = re.search(r'server= (\S+) (\d+) (\d+) \d+ (\d+ (\S+))?', full) if x: s['current']['strat'] = x.groups()[0]