Browse Source

Scripts for parsing

Vecna 6 months ago
commit
3d2383c7a1

+ 29 - 0
Parsing-results/format.py

@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+
+import csv
+import math
+
+with open("performance_stats.csv", 'r') as f:
+    stats = csv.reader(f, delimiter=',')
+
+    for row in stats:
+        if row[0] == "Protocol":
+            continue
+        proto = row[0]
+        if '%' in proto:
+            proto = proto[:-1] + "\\%"
+        req_size = row[1]
+        req_time = row[2]
+        req_std = row[3]
+        # open invitation response size is +- 1 byte
+        resp_size = row[4]
+        resp_time = row[5]
+        resp_std = row[6]
+        handle_time = row[7]
+        handle_std = row[8]
+
+        #req_time, req_std = format (req_time, req_std)
+        #resp_time, resp_std = format (resp_time, resp_std)
+        #handle_time, handle_std = format (handle_time, handle_std)
+
+        print (f"{proto} & {req_size} & {req_time} & {req_std} & {resp_size} & {resp_time} & {resp_std} & {handle_time} & {handle_std} \\\\")

+ 45 - 0
Parsing-results/get_results.sh

@@ -0,0 +1,45 @@
+#!/bin/bash
+
+for i in lox-old lox-new troll-patrol; do
+    echo "$i"
+    cd "$i"
+
+    if [ ! -e format.py ]; then
+        ln -s ../format.py
+    fi
+
+    if [ ! -e make_tables.py ]; then
+        if [ "$i" == "troll-patrol" ]; then
+            ln -s ../make_tables_tp.py make_tables.py
+        else
+            ln -s ../make_tables.py
+        fi
+    fi
+
+    if [ ! -e parse_data.sh ]; then
+        ln -s ../parse_data.sh
+    fi
+
+    if [ ! -e raw_to_csv.py ]; then
+        ln -s ../raw_to_csv.py
+    fi
+
+    if [ "$i" == "lox-old" ]; then
+        filename="appendix-b-results"
+    elif [ "$i" == "lox-new" ]; then
+        filename="table-2-results"
+    else
+        filename="table-3-results"
+    fi
+
+    cat ../table-header.tex > "../${filename}.tex"
+    cat ../"${i}-table-header.tex" >> "../${filename}.tex"
+    ./parse_data.sh | \
+        awk '/Open Invitation/,0' | \
+        sed 's/->/$\\rightarrow$/g' >> "../${filename}.tex"
+    cat ../"table-footer.tex" >> "../${filename}.tex"
+    cd ..
+
+    # Build PDF
+    while pdflatex "${filename}.tex" && grep -q "Rerun to get" "${filename}.log"; do true; done
+done

+ 18 - 0
Parsing-results/lox-new-table-header.tex

@@ -0,0 +1,18 @@
+\begin{table*}
+    \renewcommand\thetable{2}
+
+    \caption{Performance statistics for the Tor Project development
+    branch of Lox on which we based on our code.
+    We use 3,600 bridges (1,800 untrusted open-entry one-bridge
+    buckets and 600 hot spare three-bridge buckets) over 100 runs. All
+    times are reported in milliseconds (ms), and sizes are reported in
+    bytes. Results for the check blockage protocol are reported for 5,
+    50, and 100\% of trusted (invitation-only) bridges being blocked as the performance
+    changes accordingly.}
+
+    \label{tab:results-lox-new}
+
+\adjustbox{max width=\textwidth}{
+    \begin{tabular}{c|c|c|c|c|c|c|C{.125\textwidth}|c}
+        \textbf{Protocol} & \textbf{Request Size} & \textbf{Request Time} & \textbf{$\sigma$} & \textbf{Response Size} & \textbf{Response Time} & \textbf{$\sigma$} & \textbf{Response Handling Time} & \textbf{$\sigma$} \\
+        \hline

+ 19 - 0
Parsing-results/lox-old-table-header.tex

@@ -0,0 +1,19 @@
+\begin{table*}
+    \renewcommand\thetable{5}
+
+    \caption{Performance statistics for the version of the Lox code from
+    the original Lox paper. This table corresponds to Table~4 from the
+    Lox paper. We use 3,600 bridges (1,800
+    untrusted open-entry one-bridge buckets and 600 hot spare
+    three-bridge buckets) over 100 runs. All times are reported in
+    milliseconds (ms), and sizes are reported in bytes. Results for the
+    check blockage protocol are reported for 5, 50, and 100\% of trusted
+    (invitation-only)
+    bridges being blocked as the performance changes accordingly.}
+
+    \label{tab:results-lox-old}
+
+\adjustbox{max width=\textwidth}{
+    \begin{tabular}{c|c|c|c|c|c|c|C{.125\textwidth}|c}
+        \textbf{Protocol} & \textbf{Request Size} & \textbf{Request Time} & \textbf{$\sigma$} & \textbf{Response Size} & \textbf{Response Time} & \textbf{$\sigma$} & \textbf{Response Handling Time} & \textbf{$\sigma$} \\
+        \hline

+ 106 - 0
Parsing-results/make_tables.py

@@ -0,0 +1,106 @@
+import csv
+import math
+import sys
+import pandas as pd
+import numpy as np
+
+def format(mean, std):
+    if std >= 10.0:
+        m = int(round(mean/10.0)) * 10.0
+        s = int(round(std/10.0)) * 10.0
+        dec = 0
+    elif std >= 1.0:
+        m = int(round(mean))
+        s = int(round(std))
+        dec = 0
+    elif std >= 0.1:
+        m = int(round(mean*10)) / 10.0
+        s = int(round(std*10)) / 10.0
+        dec = 1
+    elif std >= 0.01:
+        m = int(round(mean*100)) / 100.0
+        s = int(round(std*100)) / 100.0
+        dec = 2
+    elif std >= 0.001:
+        m = int(round(mean*1000)) / 1000.0
+        s = int(round(std*1000)) / 1000.0
+        dec = 3
+    elif std >= 0.0001:
+        m = int(round(mean*10000)) / 10000.0
+        s = int(round(std*10000)) / 10000.0
+        dec = 4
+    m = str(m)
+    s = str(s)
+
+    if dec > 0:
+        msplit = m.split('.')
+        ssplit = s.split('.')
+        if len(msplit) < 2:
+            m = msplit[0] + '.' + '0' * dec
+        elif len(msplit[1]) < dec:
+            m = msplit[0] + '.' + msplit[1] + '0' * (dec - len(msplit[1]))
+        if len(ssplit) < 2:
+            s = ssplit[0] + '.' + '0' * dec
+        elif len(ssplit[1]) < dec:
+            s = ssplit[0] + '.' + ssplit[1] + '0' * (dec - len(ssplit[1]))
+
+    return m, s
+
+def main():
+    perf = open("performance_stats"+".csv", "w", newline='')
+    protocols=["Open Invitation", "Trust Promotion(0->1)",
+               "Trust Migration (0->1)", "Level Up (1->4)", "Issue Invitation",
+                    "Redeem Invitation", "Check Blockage 5%", "Check Blockage 50%", "Check Blockage 100%", "Blockage Migration"]
+    files = ["trust_levels.csv", "trust_promo.csv", "trust_mig.csv", "level2.csv",
+             "invitations.csv", "redeem_invites.csv","check_blockage5.csv",
+             "check_blockage50.csv","check_blockage100.csv","blockage_migration50.csv"]
+    csv_cols = ["RequestS", "RequestT","Rtstdev","ResponseS","ResponseT",
+                "ReTstdev", "ResponseHT", "RHTstdev"]
+    perf_columns = ["Protocol","Request Size", "Request Time", "sigma",
+                    "Response Size","Response Time", "sigma",
+                    "Response Handling Time", "sigma"]
+    worst_resp = 0
+    perfwriter = csv.writer(perf, delimiter=',')
+    perfwriter.writerow(perf_columns)
+
+    for i, protocol in enumerate(protocols):
+        columns = ["Percent","Bridges", "RequestS", "Rsstdev", "RequestT",
+                   "Rtstdev", "ResponseS","Restdev","ResponseT",
+                   "ReTstdev", "ResponseHT", "RHTstdev"]
+
+        with open(files[i], 'r') as f:
+            stats = csv.reader(f, delimiter=',')
+            perf_in = []
+
+            perf_in.append(protocol)
+
+            for row in stats:
+                if row[1] == "600":
+                    req_size = int(row[2])
+                    req_size_std = float(row[3])
+                    req_time = float(row[4])
+                    req_std = float(row[5])
+                    # open invitation response size is +/- 1 byte
+                    resp_size = int(math.ceil(float(row[6])))
+                    resp_size_std = float(row[7])
+                    resp_time = float(row[8])
+                    resp_std = float(row[9])
+                    handle_time = float(row[10])
+                    handle_std = float(row[11])
+
+                    req_time, req_std = format (req_time, req_std)
+                    resp_time, resp_std = format (resp_time, resp_std)
+                    handle_time, handle_std = format (handle_time, handle_std)
+
+                    perf_in.extend([req_size, req_time, req_std, resp_size, resp_time, resp_std, handle_time, handle_std])
+
+                    break
+
+            perfwriter.writerow(perf_in)
+
+    perf.close()
+    print("\nDone Tables.\nTable data output to: performance_stats.csv,\n")
+
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 108 - 0
Parsing-results/make_tables_tp.py

@@ -0,0 +1,108 @@
+import csv
+import math
+import sys
+import pandas as pd
+import numpy as np
+
+def format(mean, std):
+    if std >= 10.0:
+        m = int(round(mean/10.0)) * 10.0
+        s = int(round(std/10.0)) * 10.0
+        dec = 0
+    elif std >= 1.0:
+        m = int(round(mean))
+        s = int(round(std))
+        dec = 0
+    elif std >= 0.1:
+        m = int(round(mean*10)) / 10.0
+        s = int(round(std*10)) / 10.0
+        dec = 1
+    elif std >= 0.01:
+        m = int(round(mean*100)) / 100.0
+        s = int(round(std*100)) / 100.0
+        dec = 2
+    elif std >= 0.001:
+        m = int(round(mean*1000)) / 1000.0
+        s = int(round(std*1000)) / 1000.0
+        dec = 3
+    elif std >= 0.0001:
+        m = int(round(mean*10000)) / 10000.0
+        s = int(round(std*10000)) / 10000.0
+        dec = 4
+    m = str(m)
+    s = str(s)
+
+    if dec > 0:
+        msplit = m.split('.')
+        ssplit = s.split('.')
+        if len(msplit) < 2:
+            m = msplit[0] + '.' + '0' * dec
+        elif len(msplit[1]) < dec:
+            m = msplit[0] + '.' + msplit[1] + '0' * (dec - len(msplit[1]))
+        if len(ssplit) < 2:
+            s = ssplit[0] + '.' + '0' * dec
+        elif len(ssplit[1]) < dec:
+            s = ssplit[0] + '.' + ssplit[1] + '0' * (dec - len(ssplit[1]))
+
+    return m, s
+
+def main():
+    perf = open("performance_stats"+".csv", "w", newline='')
+    protocols=["Open Invitation", "Trust Promotion(0->1)",
+               "Trust Migration (0->1)", "Level Up (1->4)", "Issue Invitation",
+                    "Redeem Invitation", "Check Blockage 5%", "Check Blockage 50%", "Check Blockage 100%", "Blockage Migration",
+                    "Report Submit", "Report Status", "Report Resolve"]
+    files = ["trust_levels.csv", "trust_promo.csv", "trust_mig.csv", "level2.csv",
+             "invitations.csv", "redeem_invites.csv","check_blockage5.csv",
+             "check_blockage50.csv","check_blockage100.csv","blockage_migration50.csv",
+             "report_submit.csv", "report_status.csv", "report_resolve.csv"]
+    csv_cols = ["RequestS", "RequestT","Rtstdev","ResponseS","ResponseT",
+                "ReTstdev", "ResponseHT", "RHTstdev"]
+    perf_columns = ["Protocol","Request Size", "Request Time", "sigma",
+                    "Response Size","Response Time", "sigma",
+                    "Response Handling Time", "sigma"]
+    worst_resp = 0
+    perfwriter = csv.writer(perf, delimiter=',')
+    perfwriter.writerow(perf_columns)
+
+    for i, protocol in enumerate(protocols):
+        columns = ["Percent","Bridges", "RequestS", "Rsstdev", "RequestT",
+                   "Rtstdev", "ResponseS","Restdev","ResponseT",
+                   "ReTstdev", "ResponseHT", "RHTstdev"]
+
+        with open(files[i], 'r') as f:
+            stats = csv.reader(f, delimiter=',')
+            perf_in = []
+
+            perf_in.append(protocol)
+
+            for row in stats:
+                if row[1] == "600":
+                    req_size = int(row[2])
+                    req_size_std = float(row[3])
+                    req_time = float(row[4])
+                    req_std = float(row[5])
+                    # open invitation response size is +/- 1 byte
+                    resp_size = int(math.ceil(float(row[6])))
+                    resp_size_std = float(row[7])
+                    resp_time = float(row[8])
+                    resp_std = float(row[9])
+                    handle_time = float(row[10])
+                    handle_std = float(row[11])
+
+                    req_time, req_std = format (req_time, req_std)
+                    resp_time, resp_std = format (resp_time, resp_std)
+                    handle_time, handle_std = format (handle_time, handle_std)
+
+                    perf_in.extend([req_size, req_time, req_std, resp_size, resp_time, resp_std, handle_time, handle_std])
+
+                    break
+
+            perfwriter.writerow(perf_in)
+
+    perf.close()
+    print("\nDone Tables.\nTable data output to: performance_stats.csv,\n")
+
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 8 - 0
Parsing-results/parse_data.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Parse results from Lox stat tests
+echo 'Parse raw output to csv'
+
+python3 raw_to_csv.py
+python3 make_tables.py
+python3 format.py

+ 221 - 0
Parsing-results/raw_to_csv.py

@@ -0,0 +1,221 @@
+from pathlib import Path
+
+standard_check_file = open("standard_check"+".csv", "w")
+standard_check_file.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+
+for p in Path('.').glob('*.log'):
+    print(f"Parsing: {p.name.strip('.log')}\n")
+    with p.open() as log_file:
+        test_file = open(p.name.strip('.log')+".csv", "w")
+        test_file.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+        bridges = 0
+        c=False
+        red = 0
+        check = 0
+        level = 0
+        protocol = 0
+        num = 0
+        rep_sub = 0
+        rep_stat = 0
+        rep_res = 0
+        req_size = 0
+        req_size_std = 0
+        req_time = 0
+        req_time_std = 0
+        resp_size = 0
+        resp_size_std = 0
+        resp_time = 0
+        resp_time_std = 0
+        resp_handle_time = 0
+        resp_handle_std = 0
+        endline = 0
+
+        # Loop over the remaining lines in the file
+        for line in log_file:
+            if "***START" in line:
+                bridges = line.split()[1].split("*")[0]
+            if "CHECK-BLOCKAGE" in line:
+                protocol = 1
+                num = line.split("-")[6].strip('-')
+                if int(bridges) == 600:
+                    check =1
+                if not c:
+                    check_b = open("check_blockage"+str(num)+".csv", "w")
+                    check_b.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+                    c=True
+            elif "BLOCKAGE-MIGRATION" in line:
+                protocol = 2
+                num = line.split("-")[6].strip('-')
+            elif "REDEEM" in line:
+                protocol = 3
+                if not red:
+                    redeem = open("redeem_invites.csv", "w")
+                    redeem.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+                    red = 1
+            elif "ISSUE" in line:
+                protocol = 4
+            elif "OPEN" in line:
+                protocol = 5
+            elif "TRUST-PROMOTION" in line:
+                protocol = 6
+                if not level:
+                    trust_promo = open("trust_promo.csv", "w")
+                    trust_promo.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+            elif "TRUST-MIGRATION" in line:
+                protocol = 7
+                if not level:
+                    mig_file = open("trust_mig.csv", "w")
+                    mig_file.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+            elif "LEVEL-UP-2" in line:
+                protocol = 8
+                if not level:
+                    level_file = open("level2.csv", "w")
+                    level_file.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+            elif "LEVEL-UP-3" in line:
+                protocol = 9
+                if not level:
+                    level_file_t = open("level3.csv", "w")
+                    level_file_t.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+            elif "LEVEL-UP-4" in line:
+                protocol = 10
+                if not level:
+                    level_file_f = open("level4.csv", "w")
+                    level_file_f.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+                    level = 1
+            elif "REPORT-SUBMIT" in line:
+                protocol = 11
+                if not rep_sub:
+                    rep_sub_file = open("report_submit.csv", "w")
+                    rep_sub_file.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+                    rep_sub = 1
+            elif "REPORT-STATUS" in line:
+                protocol = 12
+                if not rep_stat:
+                    rep_stat_file = open("report_status.csv", "w")
+                    rep_stat_file.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+                    rep_stat = 1
+            elif "REPORT-RESOLVE" in line:
+                protocol = 13
+                if not rep_res:
+                    rep_res_file = open("report_resolve.csv", "w")
+                    rep_res_file.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+                    rep_res = 1
+            elif protocol:
+                value = line.split(" = ")
+                if value[0].startswith("Average"):
+                    if "request" in value[0]:
+                        if "size" in value[0]:
+                            raw_size = value[1].split(" ")
+                            req_size = raw_size[0]
+                        else:
+                            if "n" in value[1]:
+                                nano_sec = value[1].split("n")
+                                raw_size = float(nano_sec[0])*0.000001
+                            elif "µ" in value[1]:
+                                micro_sec = value[1].split("µ")
+                                raw_size = float(micro_sec[0])*0.001
+                            elif "m" not in value[1]:
+                                sec = value[1][:-3]
+                                raw_size = float(sec)*1000
+                            else:
+                                raw_size = value[1][:-3]
+                            req_time = raw_size
+                    else:
+                        if "size" in value[0]:
+                            raw_size = value[1].split(" ")
+                            resp_size = raw_size[0]
+                        else:
+                            if "n" in value[1]:
+                                nano_sec = value[1].split("n")
+                                raw_size = float(nano_sec[0])*0.000001
+                            elif "µ" in value[1]:
+                                micro_sec = value[1].split("µ")
+                                raw_size = float(micro_sec[0])*0.001
+                            elif "m" not in value[1]:
+                                sec = value[1][:-3]
+                                raw_size = float(sec)*1000
+                            else:
+                                raw_size = value[1][:-3]
+                            if "handling" in value[0]:
+                                resp_handle_time = raw_size
+                            else:
+                                resp_time = raw_size
+                elif value[0].startswith("Request"):
+                    if "size" in value[0]:
+                        raw_size = value[1].split(" ")
+                        req_size_std = raw_size[0]
+                    else:
+                        if "n" in value[1]:
+                            nano_sec = value[1].split("n")
+                            to_sec = float(nano_sec[0])*0.000001
+                        elif "µ" in value[1]:
+                            micro_sec = value[1].split("µ")
+                            to_sec = float(micro_sec[0])*0.001
+                        else:
+                            to_sec = value[1][:-3]
+                        req_time_std = to_sec
+                elif value[0].startswith("Response"):
+                    if "size" in value[0]:
+                        raw_size = value[1].split(" ")
+                        resp_size_std = raw_size[0]
+                    else:
+                        if "n" in value[1]:
+                            nano_sec = value[1].split("n")
+                            to_sec = float(nano_sec[0])*0.000001
+                        elif "µ" in value[1]:
+                            micro_sec = value[1].split("µ")
+                            to_sec = float(micro_sec[0])*0.001
+                        else:
+                            to_sec = value[1][:-3]
+                        if "handling" in value[0]:
+                            resp_handle_time_std = to_sec
+                            endline = 1
+                        else:
+                            resp_time_std = to_sec
+
+            if endline == 1:
+                if check == 1:
+                    standard_check_file.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                    check = 0
+                if protocol == 1:
+                    check_b.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                elif protocol == 3:
+                    redeem.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                elif protocol<6:
+                    test_file.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                else:
+                    if protocol == 6:
+                        trust_promo.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                    if protocol == 7:
+                        mig_file.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                    if protocol == 8:
+                        level_file.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                    elif protocol == 9:
+                        level_file_t.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                    elif protocol == 10:
+                        level_file_f.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                    elif protocol == 11:
+                        rep_sub_file.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                    elif protocol == 12:
+                        rep_stat_file.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                    elif protocol == 13:
+                        rep_res_file.write(str(num) + "," + str(bridges)+"," + str(req_size) + "," + str(req_size_std) + ","  + str(req_time) + "," + str(req_time_std) + ","  + str(resp_size) + "," + str(resp_size_std) + "," + str(resp_time) + "," + str(resp_time_std) + "," + str(resp_handle_time) + "," + str(resp_handle_time_std) + "\n")
+                endline = 0
+                protocol = 0
+        if level:
+            level_file.close()
+            level_file_t.close()
+            level_file_f.close()
+            trust_promo.close()
+            mig_file.close()
+        if red:
+            redeem.close()
+        if rep_sub:
+            rep_sub_file.close()
+        if rep_stat:
+            rep_stat_file.close()
+        if rep_res:
+            rep_res_file.close()
+        test_file.close()
+standard_check_file.close()
+print("Done.")

+ 4 - 0
Parsing-results/table-footer.tex

@@ -0,0 +1,4 @@
+    \end{tabular}
+}
+\end{table*}
+\end{document}

+ 6 - 0
Parsing-results/table-header.tex

@@ -0,0 +1,6 @@
+\documentclass[sigconf]{acmart}
+\usepackage{adjustbox}
+\usepackage{array}
+\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
+\begin{document}
+

+ 21 - 0
Parsing-results/troll-patrol-table-header.tex

@@ -0,0 +1,21 @@
+\begin{table*}
+    \renewcommand\thetable{3}
+
+    \caption{Performance statistics for our modified version of Lox,
+    including the Troll Patrol protocols.
+    We use 3,600 bridges (1,800 untrusted open-entry one-bridge
+    buckets and 600 hot spare three-bridge buckets) over 100 runs. All
+    times are reported in milliseconds (ms), and sizes are reported in
+    bytes. Results for the check blockage protocol are reported for 5,
+    50, and 100\% of trusted (invitation-only) bridges being blocked as the performance
+    changes accordingly.
+    The Report Submit request size
+    includes the size of the optional resolve credential that only needs
+    to be presented if the user's credential has $p\not=0$.}
+
+    \label{tab:results-troll-patrol}
+
+\adjustbox{max width=\textwidth}{
+    \begin{tabular}{c|c|c|c|c|c|c|C{.125\textwidth}|c}
+        \textbf{Protocol} & \textbf{Request Size} & \textbf{Request Time} & \textbf{$\sigma$} & \textbf{Response Size} & \textbf{Response Time} & \textbf{$\sigma$} & \textbf{Response Handling Time} & \textbf{$\sigma$} \\
+        \hline