Parcourir la source

[WIP] Proposed changes for artifact, run_tests_fast is probably a bit unhinged

Lindsey Tulloch il y a 2 ans
Parent
commit
7511a71927

+ 2 - 0
Cargo.toml

@@ -11,6 +11,7 @@ ed25519-dalek = "1"
 zkp = "0.8"
 bincode = "1"
 chrono = "0.4"
+#cfg-if = "0.1"
 rand = "0.7"
 serde = "1"
 serde_with = "1.9.1"
@@ -28,3 +29,4 @@ default = ["u64_backend"]
 u32_backend = ["curve25519-dalek/u32_backend"]
 u64_backend = ["curve25519-dalek/u64_backend"]
 simd_backend = ["curve25519-dalek/simd_backend"]
+fast = []

+ 4 - 0
Dockerfile

@@ -3,6 +3,10 @@ WORKDIR /home/lox
 ADD src/ ./src/
 ADD Cargo.toml Cargo.toml
 ADD tests/ ./tests/
+ADD run_tests_fast.sh .
+ADD Parsing-results ./Parsing-results
 ADD README.md README.md
+RUN apt-get update -y
+RUN apt-get install -y python3
 RUN cargo build --release
 ENV SHELL=/bin/bash

+ 60 - 0
Parsing-results/blockages.py

@@ -0,0 +1,60 @@
+import pandas as pd
+import matplotlib.pyplot as plt
+from matplotlib.lines import Line2D
+
+fig, (axs, axs1) = plt.subplots(2, 4, figsize=(24, 12))
+fig.suptitle("Checking for Blockage and Migration to new Bridges for" +
+             " Percentage of Bridges Blocked")
+columns = ["Percent", "RequestT", "Rtstdev", "ResponseS", "ResponseT",
+           "ReTstdev", "ResponseHT", "RHTstdev"]
+df = pd.read_csv("check_blockage.csv", usecols=columns)
+df1 = pd.read_csv("migration.csv", usecols=columns)
+fig.supxlabel('Blocked Bridges (%)')
+axs[0].set_ylabel('Request Time (ms)')
+axs[0].set_ylim([0,70])
+l1 = axs[0].plot(df.Percent, df.RequestT, color='#CC4F1B',
+            label='Request Time for Percentage of Bridges Blocked')
+axs[0].fill_between(df.Percent, df.RequestT-df.Rtstdev, df.RequestT+df.Rtstdev,
+                    alpha=0.5, edgecolor='#CC4F1B', facecolor='#FF9848')
+axs1[0].set_ylabel('Request Time (ms)')
+axs1[0].set_ylim([0,70])
+axs1[0].plot(df1.Percent, df1.RequestT, color='#1B2ACC',
+             label='Request Time for Percentage of Bridges Blocked')
+axs1[0].fill_between(df1.Percent, df1.RequestT-df1.Rtstdev,
+                    df1.RequestT+df1.Rtstdev, alpha=0.2, edgecolor='#1B2ACC',
+                    facecolor='#089FFF')
+axs[1].set_ylabel('Response Time (ms)')
+axs[1].plot(df.Percent, df.ResponseT, color='#CC4F1B',
+             label='Response Time for Percentage of Bridges Blocked')
+axs[1].fill_between(df.Percent, df.ResponseT-df.ReTstdev,
+                     df.ResponseT+df.ReTstdev, alpha=0.5, edgecolor='#CC4F1B',
+                     facecolor='#FF9848')
+axs1[1].set_ylabel('Response Time (ms)')
+axs1[1].set_ylim([0,70])
+axs1[1].plot(df1.Percent, df1.ResponseT, color='#1B2ACC',
+             label='Response Time for Percentage of Bridges Blocked')
+axs1[1].fill_between(df1.Percent, df1.ResponseT-df1.ReTstdev,
+                     df1.ResponseT+df1.ReTstdev, alpha=0.2, edgecolor='#1B2ACC',
+                     facecolor='#089FFF')
+axs[2].set_ylabel('Response Size (ms)')
+axs[2].plot(df.Percent, df.ResponseS, color='#CC4F1B',
+             label='Response Size for Percentage of Bridges Blocked')
+axs1[2].set_ylabel('Response Size (ms)')
+axs1[2].plot(df1.Percent, df1.ResponseS, color='#1B2ACC',
+             label='Response Size for Percentage of Bridges Blocked')
+axs[3].set_ylabel('Response Handling Time (ms)')
+axs[3].plot(df.Percent, df.ResponseHT, color='#CC4F1B',
+             label='Response Handling Time for Percentage of Bridges Blocked')
+axs[3].fill_between(df.Percent, df.ResponseHT-df.RHTstdev,
+                     df.ResponseHT+df.RHTstdev, alpha=0.5, edgecolor='#CC4F1B',
+                     facecolor='#FF9848')
+axs1[3].set_ylabel('Response Handling Time (ms)')
+axs1[3].set_ylim([0,70])
+axs1[3].plot(df1.Percent, df1.ResponseHT, color='#1B2ACC',
+             label='Response Handling Time for Percentage of Bridges Blocked')
+axs1[3].fill_between(df1.Percent, df1.ResponseHT-df1.RHTstdev,
+                     df1.ResponseHT+df1.RHTstdev, alpha=0.2, edgecolor='#1B2ACC',
+                     facecolor='#089FFF')
+legend_elements = [Line2D([0], [0], color='#CC4F1B', label="Check Blockage Protocol"), Line2D([0], [0], color='#1B2ACC', label="Blockage Migration Protocol")]
+fig.legend(handles=legend_elements, loc='lower right')
+fig.savefig("Performance.pdf")

+ 110 - 0
Parsing-results/check_blockages.py

@@ -0,0 +1,110 @@
+import sys
+import pandas as pd
+import matplotlib
+import matplotlib.pyplot as plt
+from matplotlib.lines import Line2D
+
+
+def main():
+
+    fig, axs = plt.subplots(1, 3, figsize=(24, 7))
+    columns = ["Percent","Bridges", "RequestT", "Rtstdev", "ResponseS", "ResponseT",
+               "ReTstdev", "ResponseHT", "RHTstdev"]
+    df = pd.read_csv("standard_check"+".csv", usecols=columns)
+    df.sort_values(["Percent"], axis=0,ascending=[False], inplace=True)
+    bridges = df.Bridges*2*3
+    fig.supxlabel('Blocked Bridges (%)', size=30)
+    axs[0].set_ylabel('Response Time (ms)', size=25)
+    axs[0].tick_params(axis='x', labelsize=15)
+    axs[0].tick_params(axis='y', labelsize=15)
+#    axs[0].set_xticklabels('Blocked Bridges (%)',fontsize=10)
+    axs[0].plot(df.Percent, df.ResponseT, color='#CC4F1B',
+                label='Response Time for Percentage of Bridges Blocked')
+    axs[0].fill_between(df.Percent, df.ResponseT-df.ReTstdev,
+                df.ResponseT+df.ReTstdev, alpha=0.5, edgecolor='#CC4F1B',
+                facecolor='#FF9848')
+    axs[1].set_ylabel('Response Size (bytes)', size=25)
+    axs[1].tick_params(axis='x', labelsize=15)
+    axs[1].tick_params(axis='y', labelsize=15)
+    axs[1].plot(df.Percent, df.ResponseS, color='#CC4F1B',
+                label='Response Size for Percentage of Bridges Blocked')
+    axs[2].set_ylabel('Response Handling Time (ms)', size=25)
+    axs[2].tick_params(axis='x', labelsize=15)
+    axs[2].tick_params(axis='y', labelsize=15)
+    axs[2].plot(df.Percent, df.ResponseHT, color='#CC4F1B',
+                label='Response Handling Time for Percentage of Bridges Blocked')
+    axs[2].fill_between(df.Percent, df.ResponseHT-df.RHTstdev,
+                df.ResponseHT+df.RHTstdev, alpha=0.5, edgecolor='#CC4F1B',
+                facecolor='#FF9848')
+    fig. tight_layout(pad=1)
+    fig.savefig("StandardCheck.pdf")
+    plt.close('all')
+
+    for n in range(5,105,5):
+        fig, axs = plt.subplots(1, 3, figsize=(24, 7))
+        columns = ["Percent","Bridges", "RequestT", "Rtstdev", "ResponseS", "ResponseT",
+               "ReTstdev", "ResponseHT", "RHTstdev"]
+        df = pd.read_csv("checkblockage"+str(n)+".csv", usecols=columns)
+        bridges = df.Bridges*2*3
+        fig.supxlabel('Total Size of Bridge Pool ('+str(n)+'% Bridges Blocked)',size=30)
+        axs[0].set_ylabel('Response Time (ms)', size=25)
+        axs[0].tick_params(axis='x', labelsize=15)
+        axs[0].tick_params(axis='y', labelsize=15)
+        axs[0].plot(bridges, df.ResponseT, color='#740202',
+                    label='Response Time for Percentage of Bridges Blocked')
+        axs[0].fill_between(bridges, df.ResponseT-df.ReTstdev,
+                            df.ResponseT+df.ReTstdev, alpha=0.5, edgecolor='#740202',
+                            facecolor='#E75252')
+        axs[1].set_ylabel('Response Size (bytes)', size=25)
+        axs[1].tick_params(axis='x', labelsize=15)
+        axs[1].tick_params(axis='y', labelsize=15)
+        axs[1].plot(bridges, df.ResponseS, color='#740202',
+                    label='Response Size for Percentage of Bridges Blocked')
+        axs[2].set_ylabel('Response Handling Time (ms)', size=25)
+        axs[2].tick_params(axis='x', labelsize=15)
+        axs[2].tick_params(axis='y', labelsize=15)
+        axs[2].plot(bridges, df.ResponseHT, color='#740202',
+                    label='Response Handling Time for Percentage of Bridges Blocked')
+        axs[2].fill_between(bridges, df.ResponseHT-df.RHTstdev,
+                            df.ResponseHT+df.RHTstdev, alpha=0.5, edgecolor='#740202',
+                            facecolor='#E75252')
+        fig. tight_layout(pad=1)
+        fig.savefig("PerformanceVaried"+str(n)+".pdf")
+        print("\nDone PerformanceVaried"+str(n)+" Plot.\nOutput to: PerformanceVaried"+str(n)+".pdf")
+        plt.close('all')
+
+
+def set_plot_options():
+      options = {
+          'font.size': 12,
+          'figure.figsize': (4,2),
+          'figure.dpi': 100.0,
+          'figure.subplot.left': 0.20,
+          'figure.subplot.right': 0.97,
+          'figure.subplot.bottom': 0.20,
+          'figure.subplot.top': 0.90,
+          'grid.color': '0.1',
+          'grid.linestyle': ':',
+          #'grid.linewidth': 0.5,
+          'axes.grid' : True,
+          #'axes.grid.axis' : 'y',
+          #'axes.axisbelow': True,
+          'axes.titlesize' : 25,
+          'axes.labelsize' : 25,
+          'axes.formatter.limits': (-4,4),
+          'xtick.labelsize' : 30,#get_tick_font_size_10(),
+          'ytick.labelsize' : 30,#get_tick_font_size_10(),
+          'lines.linewidth' : 2.0,
+          'lines.markeredgewidth' : 0.5,
+          'lines.markersize' : 15,
+      }
+
+      for option_key in options:
+          matplotlib.rcParams[option_key] = options[option_key]
+      if 'figure.max_num_figures' in matplotlib.rcParams:
+          matplotlib.rcParams['figure.max_num_figures'] = 100
+      if 'figure.max_open_warning' in matplotlib.rcParams:
+          matplotlib.rcParams['figure.max_open_warning'] = 100
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 61 - 0
Parsing-results/check_blockages_server.py

@@ -0,0 +1,61 @@
+import sys
+import pandas as pd
+import matplotlib
+import matplotlib.pyplot as plt
+from matplotlib.lines import Line2D
+
+def main():
+    set_plot_options()
+    fig, axs = plt.subplots(1, 2, figsize=(24, 7))
+    columns = ["Percent", "RequestT", "Rtstdev", "ResponseS", "ResponseT",
+               "ReTstdev"]
+    df = pd.read_csv("check_blockage.csv", usecols=columns)
+    fig.supxlabel('Blocked Bridges (%)')
+    axs[0].set_ylabel('Response Time (ms)')
+    axs[0].plot(df.Percent, df.ResponseT, color='#CC4F1B',
+                label='Response Time for Percentage of Bridges Blocked')
+    axs[0].fill_between(df.Percent, df.ResponseT-df.ReTstdev,
+                        df.ResponseT+df.ReTstdev, alpha=0.5, edgecolor='#CC4F1B',
+                        facecolor='#FF9848')
+    axs[1].set_ylabel('Response Size (ms)')
+    axs[1].plot(df.Percent, df.ResponseS, color='#CC4F1B',
+                label='Response Size for Percentage of Bridges Blocked')
+    fig.savefig("Performance2.pdf")
+
+
+def set_plot_options():
+      options = {
+          'font.size': 12,
+          'figure.figsize': (4,2),
+          'figure.dpi': 100.0,
+          'figure.subplot.left': 0.20,
+          'figure.subplot.right': 0.97,
+          'figure.subplot.bottom': 0.20,
+          'figure.subplot.top': 0.90,
+          'grid.color': '0.1',
+          'grid.linestyle': ':',
+          #'grid.linewidth': 0.5,
+          'axes.grid' : True,
+          #'axes.grid.axis' : 'y',
+          #'axes.axisbelow': True,
+          'axes.titlesize' : 'x-large',
+          'axes.labelsize' : 'x-large',
+          'axes.formatter.limits': (-4,4),
+          'xtick.labelsize' : 20,#get_tick_font_size_10(),
+          'ytick.labelsize' : 20,#get_tick_font_size_10(),
+          'lines.linewidth' : 2.0,
+          'lines.markeredgewidth' : 0.5,
+          'lines.markersize' : 10,
+      }
+
+      for option_key in options:
+          matplotlib.rcParams[option_key] = options[option_key]
+      if 'figure.max_num_figures' in matplotlib.rcParams:
+          matplotlib.rcParams['figure.max_num_figures'] = 100
+      if 'figure.max_open_warning' in matplotlib.rcParams:
+          matplotlib.rcParams['figure.max_open_warning'] = 100
+      if 'legend.ncol' in matplotlib.rcParams:
+         matplotlib.rcParams['legend.ncol'] = 100
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 152 - 0
Parsing-results/make_invited_plot.py

@@ -0,0 +1,152 @@
+#!/usr/bin/env python
+
+import sys
+import json
+import lzma
+import datetime
+import numpy as np
+
+import matplotlib
+import matplotlib.pyplot as pyplot
+import matplotlib.colors as mcolors
+
+
+def main():
+    set_plot_options()
+    days=np.arange(180)
+    ft = []
+
+    # initialize users to 20
+    users = 20
+    total_users = users
+    g = 0
+    h = 0
+    i = 0
+    g_two = 0
+    h_two = 0
+    i_two = 0
+    g_two_two = 0
+    h_two_two = 0
+    i_two_two = 0
+    g_two_four = 0
+    h_two_four = 0
+    i_two_four = 0
+    g_four = 0
+    g_four_two = 0
+    h_four = 0
+    i_four = 0
+    g_six = 0
+    h_six = 0
+    i_six = 0
+    g_users = 0
+    h_users = 0
+    i_users = 0
+    g_two_users = 0
+    h_two_users = 0
+
+    pyplot.figure()
+    for f in days:
+        if g > 1:
+            g = g+1
+        if h > 1:
+            h = h+1
+        if g_two > 1:
+            g_two = g_two+1
+        if h_two > 1:
+            h_two = h_two+1
+        if g_two_two > 1:
+            g_two_two = g_two_two+1
+        if h_two_two > 1:
+            h_two_two = h_two_two+1
+        if g_two_four > 1:
+            g_two_four = g_two_four+1
+        if h_two_four > 1:
+            h_two_four = h_two_four+1
+        if g_four > 1:
+            g_four = g_four+1
+        if g_four_two > 1:
+            g_four_two = g_four_two+1
+        if f == 72:
+            g = 44
+            g_users = users*2
+            total_users = total_users+g_users
+        if f == 128:
+            h= 44
+            h_users = users*4
+            total_users = total_users+h_users
+        if g == 72:
+            g_two_users = g_users * 2
+            total_users = total_users+g_two_users
+            g_two = 44
+        if g_two == 72:
+            g_two_two = 44
+            g_two_two_users = g_two_users*2
+            total_users = total_users+g_two_two_users
+        if g_two_two == 72:
+            g_six_users = g_two_two_users*2
+            total_users = total_users+g_six_users
+        if h == 72:
+            h_two_users = h_users * 2
+            total_users = total_users+h_two_users
+            h_two =44
+        if g == 128:
+            g_four = 44
+            g_four_users = g_users* 4
+            total_users = total_users+g_four_users
+        if h_two == 72:
+            h_two_two = 44
+            h_two_two_users = h_two_users*2
+            total_users = total_users+h_two_two_users
+        if g_four == 72:
+            g_four_two = 44
+            g_four_two_users = g_four_users*2
+            total_users = total_users+g_four_two_users
+        x = total_users
+        ft.append(x)
+
+    pyplot.plot(days, ft, label='Invited Users')
+
+    pyplot.ylabel("Users")
+    pyplot.xlabel("Number of Days")
+#    pyplot.title("Average Number of Bridge Users for 1 Month Old Bridges November 2021")
+
+
+#    pyplot.legend(title="Protocols", loc="upper left")
+    pyplot.tight_layout(pad=1)
+    pyplot.savefig("invited-users.pdf")
+
+def set_plot_options():
+    options = {
+        #'backend': 'PDF',
+        'font.size': 12,
+        'figure.figsize': (7,5),
+        'figure.dpi': 100.0,
+        'axes.grid' : True,
+        'axes.xmargin' : 0.01,
+        'axes.grid.axis' : 'y',
+        'axes.axisbelow': True,
+        'axes.titlesize' : 'medium',
+        'axes.labelsize' : 'large',
+        'axes.formatter.limits': (-6,6),
+        'xtick.labelsize' : 10,#get_tick_font_size_10(),
+        'ytick.labelsize' : 10,
+        'lines.linewidth' : 2.0,
+        'lines.markersize' : 10,
+        # turn on the following to embedd fonts; requires latex
+        'ps.useafm' : True,
+        'pdf.use14corefonts' : True,
+        'text.usetex' : False,
+    }
+
+    for option_key in options:
+        matplotlib.rcParams[option_key] = options[option_key]
+
+    if 'figure.max_num_figures' in matplotlib.rcParams:
+        matplotlib.rcParams['figure.max_num_figures'] = 100
+    if 'figure.max_open_warning' in matplotlib.rcParams:
+        matplotlib.rcParams['figure.max_open_warning'] = 100
+    if 'legend.ncol' in matplotlib.rcParams:
+        matplotlib.rcParams['legend.ncol'] = 100
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 79 - 0
Parsing-results/make_steady.py

@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+
+import sys
+import json
+import lzma
+import numpy as np
+
+import matplotlib
+import matplotlib.pyplot as pyplot
+import matplotlib.colors as mcolors
+
+
+def main():
+    set_plot_options()
+    buckets = [600, 1200, 1800, 2400, 3000]
+    n = 1000000
+    ft = []
+
+    pyplot.figure()
+    for b in buckets:
+        delta = np.arange(1/10,1,.01)
+        x = []
+        for d in delta:
+            p = n*(1.61 + (14.71/d+23.725/d**2)/b) / 86400000
+            x.append(p)
+        ft.append(x)
+
+
+    pyplot.plot(delta, ft[0], label='600 Buckets')
+    pyplot.plot(delta, ft[1], linestyle='dotted', label='1200 Buckets')
+    pyplot.plot(delta, ft[2], linestyle='dashed', label='1800 Buckets')
+    pyplot.plot(delta, ft[3], linestyle='dashdot', label='2400 Buckets')
+    pyplot.plot(delta, ft[4], label='3000 Buckets')
+    pyplot.ylim(bottom=0)
+
+    pyplot.xlabel(r'$\Delta$')
+    pyplot.ylabel("Cores / Million Users")
+#    pyplot.title("Average Number of Bridge Users for 1 Month Old Bridges November 2021")
+
+
+    pyplot.legend(loc="upper right")
+    pyplot.tight_layout(pad=1)
+    pyplot.savefig("core-users.pdf")
+
+def set_plot_options():
+    options = {
+        #'backend': 'PDF',
+        'font.size': 18,
+        'figure.figsize': (7,4),
+        'figure.dpi': 100.0,
+        'axes.grid' : True,
+        'axes.xmargin' : 0,
+        'axes.grid.axis' : 'y',
+        'axes.axisbelow': True,
+        'axes.titlesize' : 'medium',
+        'axes.labelsize' : 'large',
+        'axes.formatter.limits': (-6,6),
+        'xtick.labelsize' : 18,#get_tick_font_size_10(),
+        'ytick.labelsize' : 18,
+        'lines.linewidth' : 2.0,
+        'lines.markersize' : 10,
+        # turn on the following to embedd fonts; requires latex
+        'ps.useafm' : True,
+        'pdf.use14corefonts' : True,
+        'text.usetex' : False,
+    }
+
+    for option_key in options:
+        matplotlib.rcParams[option_key] = options[option_key]
+
+    if 'figure.max_num_figures' in matplotlib.rcParams:
+        matplotlib.rcParams['figure.max_num_figures'] = 100
+    if 'figure.max_open_warning' in matplotlib.rcParams:
+        matplotlib.rcParams['figure.max_open_warning'] = 100
+    if 'legend.ncol' in matplotlib.rcParams:
+        matplotlib.rcParams['legend.ncol'] = 100
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 102 - 0
Parsing-results/make_tables.py

@@ -0,0 +1,102 @@
+import csv
+import sys
+import pandas as pd
+import numpy as np
+
+
+def main():
+    perf = open("performance_stats"+".csv", "w", newline='')
+#    latency = open("latency.csv", "w", newline='')
+#    load = open("load.csv", "w", newline='')
+#    bursty = open("burst.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 = ["updated_levels.csv", "trust_promo.csv", "trust_mig.csv", "level2.csv",
+             "issue_invites.csv", "redeem_invites.csv","checkblockage5.csv",
+             "checkblockage50.csv","checkblockage100.csv","updated_blockage50.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"]
+#    lat_columns = ["Protocol", "Client Side Latency (ms)", "Users/s Response",
+#                   "ms/Response"]
+#    load_columns = ["Protocol", "Users/core", "User/day Requests",
+#                   "Users/week Requests", "Users/month Requests"]
+    worst_resp = 0
+    perfwriter = csv.writer(perf, delimiter=',')
+    perfwriter.writerow(perf_columns)
+#    latwriter = csv.writer(latency, delimiter=',')
+#    latwriter.writerow(lat_columns)
+#    loadwriter = csv.writer(load, delimiter=',')
+#    loadwriter.writerow(load_columns)
+
+    for i, protocol in enumerate(protocols):
+        columns = ["Percent","Bridges", "RequestS", "Rsstdev", "RequestT",
+                   "Rtstdev", "ResponseS","Restdev","ResponseT",
+                   "ReTstdev", "ResponseHT", "RHTstdev"]
+        df = pd.read_csv(files[i], usecols=columns)
+        perf_in = []
+ #       lat_in = []
+ #       req = 0.0
+
+        perf_in.append(protocol)
+ #       lat_in.append(protocol)
+        for item in csv_cols:
+            row = df[item].loc[df['Bridges']==900].values
+            if "stdev" in item:
+                rounded = np.round(row[0], decimals=1)
+            else:
+                rounded = np.round(row[0], decimals=3)
+            perf_in.append(rounded)
+            rounded = np.round(row[0], decimals=1)
+            if item == "RequestT":
+                req = np.round(rounded, decimals=1)
+ #               lat_in.append(req)
+ #           elif item == "ResponseHT":
+ #               lat_in[1]=np.round(req+rounded, decimals=1)
+            elif item == "ResponseT":
+                resp_sec = np.round(1000/rounded, decimals=1)
+                resp_core = resp_sec/(1/(60*60*24))
+                if rounded > worst_resp:
+                    worst_resp = rounded
+
+#                lat_in.append(resp_sec)
+#                lat_in.append(rounded)
+
+
+        perfwriter.writerow(perf_in)
+#        latwriter.writerow(lat_in)
+
+    for i, protocol in enumerate(protocols):
+        columns = ["Percent","Bridges", "RequestS", "Rsstdev", "RequestT",
+                   "Rtstdev", "ResponseS","Restdev","ResponseT",
+                   "ReTstdev", "ResponseHT", "RHTstdev"]
+        df = pd.read_csv(files[i], usecols=columns)
+#        load_in = []
+#        load_in.append(protocol)
+        row = df['ResponseT'].loc[df['Bridges']==900].values
+        rounded = np.round(row[0], decimals=3)
+        resp_sec = np.round(1000/rounded, decimals=3)
+        resp_core = int(resp_sec/(1/(60*60*24)))
+#        load_in.append(resp_core)
+        if worst_resp > rounded:
+            secs = int(worst_resp/1000)
+#            load_in.append(resp_core*secs)
+#            load_in.append(resp_core*7*secs)
+#            load_in.append(resp_core*30*secs)
+ #       else:
+ #           load_in.append(resp_core)
+ #           load_in.append(resp_core*7)
+ #           load_in.append(resp_core*30)
+ #       loadwriter.writerow(load_in)
+
+    perf.close()
+#    latency.close()
+#    load.close()
+    print("\nDone Tables.\nTable data output to: performance_stats.csv,\n")# latency.csv, load.csv\n")
+
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 14 - 0
Parsing-results/parse_data.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Parse results from Lox stat tests
+
+echo 'Parse raw output to csv'
+
+python3 raw_to_csv.py
+
+echo 'Make plots for data'
+
+python3 check_blockages.py
+python3 trust_promo_plot.py
+python3 make_tables.py
+python3 make_steady.py

+ 63 - 0
Parsing-results/performance.py

@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+
+import sys
+import pandas as pd
+import matplotlib
+import matplotlib.pyplot as plt
+from matplotlib.lines import Line2D
+
+
+def main():
+    set_plot_options()
+    fig, axs = plt.subplots(1)
+    columns = ["Percent","Bridges", "RequestT", "Rtstdev", "ResponseS", "ResponseT",
+               "ReTstdev", "ResponseHT", "RHTstdev"]
+    df = pd.read_csv("standard_check"+".csv", usecols=columns)
+    df.sort_values(["Percent"], axis=0,ascending=[False], inplace=True)
+    bridges = df.Bridges*2*3
+    axs.set_xlabel('Blocked Bridges (%)')
+    axs.set_ylabel('Response Time (ms)')
+    axs.plot(df.Percent, df.ResponseT, color='#CC4F1B',
+                label='Response Time for Percentage of Bridges Blocked')
+    axs.set_ylim(bottom=0)
+    axs.fill_between(df.Percent, df.ResponseT-df.ReTstdev,
+                df.ResponseT+df.ReTstdev, alpha=0.5, edgecolor='#CC4F1B',
+                facecolor='#FF9848')
+    fig. tight_layout(pad=1)
+    fig.savefig("StandardCheck.pdf")
+
+def set_plot_options():
+    options = {
+        #'backend': 'PDF',
+        'font.size': 18,
+        'figure.figsize': (7,3.5),
+        'figure.dpi': 100.0,
+        'axes.grid' : True,
+        'axes.xmargin' : 0,
+        'axes.grid.axis' : 'y',
+        'axes.axisbelow': True,
+        'axes.titlesize' : 'medium',
+        'axes.labelsize' : 'large',
+        'axes.formatter.limits': (-6,6),
+        'xtick.labelsize' : 18,#get_tick_font_size_10(),
+        'ytick.labelsize' : 18,
+        'lines.linewidth' : 2.0,
+        'lines.markersize' : 10,
+        # turn on the following to embedd fonts; requires latex
+        'ps.useafm' : True,
+        'pdf.use14corefonts' : True,
+        'text.usetex' : False,
+    }
+
+    for option_key in options:
+        matplotlib.rcParams[option_key] = options[option_key]
+
+    if 'figure.max_num_figures' in matplotlib.rcParams:
+        matplotlib.rcParams['figure.max_num_figures'] = 100
+    if 'figure.max_open_warning' in matplotlib.rcParams:
+        matplotlib.rcParams['figure.max_open_warning'] = 100
+    if 'legend.ncol' in matplotlib.rcParams:
+        matplotlib.rcParams['legend.ncol'] = 100
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 62 - 0
Parsing-results/pets_plots.py

@@ -0,0 +1,62 @@
+import sys
+import pandas as pd
+import matplotlib
+import matplotlib.pyplot as plt
+from matplotlib.lines import Line2D
+
+
+def main():
+
+    plt.figure(figsize=(9, 5))
+    columns = ["Percent","Bridges", "RequestT", "Rtstdev", "ResponseS", "ResponseT",
+               "ReTstdev", "ResponseHT", "RHTstdev"]
+    df = pd.read_csv("standard_check"+".csv", usecols=columns)
+    df.sort_values(["Percent"], axis=0,ascending=[False], inplace=True)
+    bridges = df.Bridges*2*3
+    plt.xlabel('Blocked Bridges (%)', size=20)
+    plt.ylabel('Response Time (ms)', size=20)
+    plt.tick_params(axis='x', labelsize=15)
+    plt.tick_params(axis='y', labelsize=15)
+    plt.plot(df.Percent, df.ResponseT, color='#CC4F1B',
+                label='Response Time for Percentage of Bridges Blocked')
+    plt.fill_between(df.Percent, df.ResponseT-df.ReTstdev,
+                df.ResponseT+df.ReTstdev, alpha=0.5, edgecolor='#CC4F1B',
+                facecolor='#FF9848')
+    plt.tight_layout(pad=1)
+    plt.savefig("../../PETS22/figures/StandardCheck.pdf")
+    plt.close('all')
+
+def set_plot_options():
+      options = {
+          'font.size': 12,
+          'figure.figsize': (10,2),
+          'figure.dpi': 100.0,
+          'figure.subplot.left': 0.20,
+          'figure.subplot.right': 0.97,
+          'figure.subplot.bottom': 0.20,
+          'figure.subplot.top': 0.90,
+          'grid.color': '0.1',
+          'grid.linestyle': ':',
+          #'grid.linewidth': 0.5,
+          'axes.grid' : True,
+          #'axes.grid.axis' : 'y',
+          #'axes.axisbelow': True,
+          'axes.titlesize' : 25,
+          'axes.labelsize' : 25,
+          'axes.formatter.limits': (-4,4),
+          'xtick.labelsize' : 30,#get_tick_font_size_10(),
+          'ytick.labelsize' : 30,#get_tick_font_size_10(),
+          'lines.linewidth' : 2.0,
+          'lines.markeredgewidth' : 0.5,
+          'lines.markersize' : 15,
+      }
+
+      for option_key in options:
+          matplotlib.rcParams[option_key] = options[option_key]
+      if 'figure.max_num_figures' in matplotlib.rcParams:
+          matplotlib.rcParams['figure.max_num_figures'] = 100
+      if 'figure.max_open_warning' in matplotlib.rcParams:
+          matplotlib.rcParams['figure.max_open_warning'] = 100
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 178 - 0
Parsing-results/raw_to_csv.py

@@ -0,0 +1,178 @@
+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=0
+        red = 0
+        check = 0
+        level = 0
+        protocol = 0
+        num = 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) == 900:
+                    check =1
+                if not c:
+                    check_b = open("checkblockage"+str(num)+".csv", "w")
+                    check_b.write("Percent,Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+                    c=1
+            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 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 "µ" 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 "µ" 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 "µ" 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 "µ" 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")
+                endline = 0
+                protocol = 0
+        if level:
+            level_file.close()
+            level_file_t.close()
+            level_file_f.close()
+            trust_promo.close()
+            mig_file.close()
+        if check_b:
+            check_b.close()
+        if red:
+            redeem.close()
+        test_file.close()
+standard_check_file.close()
+print("Done.")

+ 86 - 0
Parsing-results/trust_promo.py

@@ -0,0 +1,86 @@
+log_file = open("updated_levels.log", "r").readlines()
+trust_promo_file = open("trust_promo"+".csv", "w")
+trust_promo_file.write("Bridges,RequestS,Rsstdev,RequestT,Rtstdev,ResponseS,Restdev,ResponseT,ReTstdev,ResponseHT,RHTstdev\n")
+
+
+bridges = 0
+promo = 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]
+    elif "TRUST-PROMOTION" in line:
+        promo = 1
+    elif promo:
+        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:
+                    raw_size = value[1]
+                    req_time = raw_size[:-3]
+            else:
+                if "size" in value[0]:
+                    raw_size = value[1].split(" ")
+                    resp_size = raw_size[0]
+                else:
+                    raw_size = value[1]
+                    if "handling" in value[0]:
+                        resp_handle_time = raw_size[:-3]
+                    elif (value[1][-3]) != "m":
+                        sec = value[1][:-3]
+                        resp_time = float(sec)*1000
+                    else:
+                        resp_time = raw_size[:-3]
+        elif value[0].startswith("Request"):
+            if "size" in value[0]:
+                raw_size = value[1].split(" ")
+                req_size_std = raw_size[0]
+            else:
+                if "µ" 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]
+            elif "bytes" in value[1]:
+                continue
+            else:
+                if "µ" 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 promo == 1:
+                trust_promo_file.write(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")
+                promo = 0
+                endline = 0
+
+trust_promo_file.close()
+print("Done.")

+ 74 - 0
Parsing-results/trust_promo_plot.py

@@ -0,0 +1,74 @@
+import sys
+import pandas as pd
+import matplotlib
+import matplotlib.pyplot as plt
+from matplotlib.lines import Line2D
+
+
+def main():
+
+    fig, axs = plt.subplots(1, 3, figsize=(24, 7))
+    columns = ["Bridges", "RequestT", "Rtstdev", "ResponseS", "ResponseT",
+               "ReTstdev", "ResponseHT", "RHTstdev"]
+    df = pd.read_csv("trust_promo"+".csv", usecols=columns)
+    bridges = df.Bridges*2*3
+    fig.supxlabel('Total Size of Bridge Pool',size=30)
+    axs[0].set_ylabel('Response Time (ms)', size=25)
+    axs[0].tick_params(axis='x', labelsize=15)                                  
+    axs[0].tick_params(axis='y', labelsize=15)     
+    axs[0].plot(bridges, df.ResponseT, color='#29135F',
+                label='Response Time for Trust Promotion')
+    axs[0].fill_between(bridges, df.ResponseT-df.ReTstdev,
+                        df.ResponseT+df.ReTstdev, alpha=0.5, edgecolor='#29135F',
+                        facecolor='#8967E2')
+    axs[1].set_ylabel('Response Size (bytes)', size=25)
+    axs[1].tick_params(axis='x', labelsize=15)                                  
+    axs[1].tick_params(axis='y', labelsize=15)         
+    axs[1].plot(bridges, df.ResponseS, color='#29135F',
+                label='Response Size for Trust Promotion')
+    axs[2].set_ylabel('Response Handling Time (ms)', size=25)
+    axs[2].tick_params(axis='x', labelsize=15)                                  
+    axs[2].tick_params(axis='y', labelsize=15)     
+    axs[2].plot(bridges, df.ResponseHT, color='#29135F',
+                label='Response Handling Time for Trust Promotion')
+    axs[2].fill_between(bridges, df.ResponseHT-df.RHTstdev,
+                        df.ResponseHT+df.RHTstdev, alpha=0.5, edgecolor='#29135F',
+                        facecolor='#8967E2')
+    fig. tight_layout(pad=1)
+    fig.savefig("TrustPromotion.pdf")
+    print("\nDone Trust Promotion Plot.\nOutput to: TrustPromotion.pdf")
+
+def set_plot_options():
+      options = {
+          'font.size': 12,
+          'figure.figsize': (4,2),
+          'figure.dpi': 100.0,
+          'figure.subplot.left': 0.20,
+          'figure.subplot.right': 0.97,
+          'figure.subplot.bottom': 0.20,
+          'figure.subplot.top': 0.90,
+          'grid.color': '0.1',
+          'grid.linestyle': ':',
+          #'grid.linewidth': 0.5,
+          'axes.grid' : True,
+          #'axes.grid.axis' : 'y',
+          #'axes.axisbelow': True,
+          'axes.titlesize' : 'large',
+          'axes.labelsize' : 'x-large',
+          'axes.formatter.limits': (-4,4),
+          'xtick.labelsize' : 20,#get_tick_font_size_10(),
+          'ytick.labelsize' : 20,#get_tick_font_size_10(),
+          'lines.linewidth' : 2.0,
+          'lines.markeredgewidth' : 0.5,
+          'lines.markersize' : 10,
+      }
+
+      for option_key in options:
+          matplotlib.rcParams[option_key] = options[option_key]
+      if 'figure.max_num_figures' in matplotlib.rcParams:
+          matplotlib.rcParams['figure.max_num_figures'] = 100
+      if 'figure.max_open_warning' in matplotlib.rcParams:
+          matplotlib.rcParams['figure.max_open_warning'] = 100
+
+if __name__ == "__main__":
+    sys.exit(main())

+ 30 - 6
README.md

@@ -10,7 +10,7 @@ Lox is written in rust and requires `cargo` to test. [Install Rust](https://www.
 ./run-lox.sh
 ```
 
-### To run the tests used for our experimental results run:
+### To run the full tests used for our experimental results run:
 
 ```
 cargo test --release -- --nocapture TESTNAME
@@ -19,9 +19,9 @@ cargo test --release -- --nocapture TESTNAME
 Where `TESTNAME` is one of:
 
 ```
-stats_test_trust_levels 
+stats_test_trust_levels
 stats_test_invitations
-stats_test_percent_blockage_migration_05 
+stats_test_percent_blockage_migration_05
 stats_test_percent_blockage_migration_010
 stats_test_percent_blockage_migration_15
 stats_test_percent_blockage_migration_20
@@ -29,11 +29,11 @@ stats_test_percent_blockage_migration_25
 stats_test_percent_blockage_migration_30
 stats_test_percent_blockage_migration_35
 stats_test_percent_blockage_migration_40
-stats_test_percent_blockage_migration_45 
+stats_test_percent_blockage_migration_45
 stats_test_percent_blockage_migration_50
 stats_test_percent_blockage_migration_55
 stats_test_percent_blockage_migration_60
-stats_test_percent_blockage_migration_65 
+stats_test_percent_blockage_migration_65
 stats_test_percent_blockage_migration_70
 stats_test_percent_blockage_migration_75
 stats_test_percent_blockage_migration_80
@@ -43,7 +43,31 @@ stats_test_percent_blockage_migration_95
 stats_test_percent_blockage_migration_100
 ```
 
-Each test takes approximately 20-30 hours to run.
+Each test takes approximately 20-30 hours to run. However, this can be improved
+by passing the `fast` feature. Using this feature, our tests are run for 100
+users instead of 10000 users and will produce results comparable to our
+reported results (with larger error margins). To run individual tests with this
+flag run:
+
+```
+  cargo test --release --features=fast -- --nocapture TESTNAME
+ ```
+
+ To run all tests in fast mode and output the results to the Parsing-results
+ director, run:
+
+```
+./run_tests_fast
+```
+***Note that this will start 22 different processes***
+
+Once the tests have been run, tables and graphs can be generated by running:
+
+```
+./parse_results
+```
+
+
 
 Note that: our implementation is coded such that the reachability certificate expires at 00:00 UTC. A workaround has been included in each test to pause if it is too close to this time so the request won't fail. In reality, if the bucket is still reachable, a user could simply request a new reachability token if their request fails for this reason (a new certificate should be available prior to the outdated certificate expiring).
 

+ 29 - 0
run_tests_fast.sh

@@ -0,0 +1,29 @@
+#!/bin/bash
+
+cargo test --release --features=fast -- --nocapture stats_test_trust_levels > trust_levels.log&
+cargo test --release --features=fast -- --nocapture stats_test_invitations > invitations.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_05 > blockage_migration_05.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_010 > blockage_migration_010.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_20 > blockage_migration_20.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_25 > blockage_migration_25.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_30 > blockage_migration_30.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_35 > blockage_migration_35.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_40 > blockage_migration_40.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_45 > blockage_migration_45.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_50 > blockage_migration_50.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_55 > blockage_migration_55.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_60 > blockage_migration_60.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_65 > blockage_migration_65.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_70 > blockage_migration_70.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_75 > blockage_migration_75.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_80 > blockage_migration_80.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_85 > blockage_migration_85.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_90 > blockage_migration_90.log&
+cargo test --release --features=fast -- --nocapture stats_test_percent_blockage_migration_95 > blockage_migration_95.log&
+cargo test release --features=fast -- --nocapture stats_test_percent_blockage_migration_100 > blockage_migration_100.log&
+wait
+echo "Completed all tests, now parsing results"
+mv *.log Parsing-results
+./parse_data.sh
+echo "Parse results are in the Parsing-results folder."
+

+ 37 - 22
src/tests.rs

@@ -11,6 +11,20 @@ use std::collections::HashSet;
 use std::thread;
 use std::time::{Duration, Instant};
 
+#[cfg(feature = "fast")]
+const USERS: usize = 100;
+#[cfg(not(feature = "fast"))]
+const USERS: usize = 10000;
+
+/*cfg_if::cfg_if! {
+     if #[cfg(feature = "fast")]{
+         const USERS: usize = 10;
+     } else {
+         const USERS: usize = 10000;
+     }
+}
+*/
+
 struct PerfStat {
     // Report performance metrics for each test
     req_len: usize,
@@ -751,7 +765,7 @@ fn stats_test_trust_levels() {
         let mut open_req_time: Vec<f64> = Vec::new();
         let mut open_resp_time: Vec<f64> = Vec::new();
         let mut open_resp_handle_time: Vec<f64> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -874,7 +888,7 @@ fn stats_test_invitations() {
         let mut red_req_time: Vec<f64> = Vec::new();
         let mut red_resp_time: Vec<f64> = Vec::new();
         let mut red_resp_handle_time: Vec<f64> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
 
             if h.hour() == 23 && h.minute() == 59 {
@@ -921,11 +935,12 @@ fn stats_test_invitations() {
 #[test]
 fn stats_test_percent_blockage_migration_05() {
     let buckets: Vec<u16> = vec![150, 300, 450, 600, 750, 900, 1050, 1200, 1350, 1500];
+    println!("USERS:{}",USERS);
 
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -958,7 +973,7 @@ fn stats_test_percent_blockage_migration_010() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -991,7 +1006,7 @@ fn stats_test_percent_blockage_migration_15() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1024,7 +1039,7 @@ fn stats_test_percent_blockage_migration_20() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1057,7 +1072,7 @@ fn stats_test_percent_blockage_migration_25() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1090,7 +1105,7 @@ fn stats_test_percent_blockage_migration_30() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1123,7 +1138,7 @@ fn stats_test_percent_blockage_migration_35() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1156,7 +1171,7 @@ fn stats_test_percent_blockage_migration_40() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1189,7 +1204,7 @@ fn stats_test_percent_blockage_migration_45() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1222,7 +1237,7 @@ fn stats_test_percent_blockage_migration_50() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1255,7 +1270,7 @@ fn stats_test_percent_blockage_migration_55() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1288,7 +1303,7 @@ fn stats_test_percent_blockage_migration_60() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1321,7 +1336,7 @@ fn stats_test_percent_blockage_migration_65() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1354,7 +1369,7 @@ fn stats_test_percent_blockage_migration_70() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1387,7 +1402,7 @@ fn stats_test_percent_blockage_migration_75() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1420,7 +1435,7 @@ fn stats_test_percent_blockage_migration_80() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1453,7 +1468,7 @@ fn stats_test_percent_blockage_migration_85() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1486,7 +1501,7 @@ fn stats_test_percent_blockage_migration_90() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1519,7 +1534,7 @@ fn stats_test_percent_blockage_migration_95() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");
@@ -1552,7 +1567,7 @@ fn stats_test_percent_blockage_migration_100() {
     for x in buckets {
         let mut th = TestHarness::new_buckets(x, x);
         let mut credentials: Vec<cred::Lox> = Vec::new();
-        for _ in 0..10000 {
+        for _ in 0..USERS {
 	    let h: NaiveTime = DateTime::time(&Utc::now());
             if h.hour() == 23 && h.minute() == 59 {
                 println!("Wait for UTC 00:00");