Browse Source

Copy files for parsing results from old lox project

Vecna 3 months ago
parent
commit
d5c2beae65

+ 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())

+ 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())

+ 68 - 0
Parsing-results/make_tables.py

@@ -0,0 +1,68 @@
+import csv
+import sys
+import pandas as pd
+import numpy as np
+
+
+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"]
+        df = pd.read_csv(files[i], usecols=columns)
+        perf_in = []
+
+        perf_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)
+            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
+
+
+        perfwriter.writerow(perf_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)
+        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)))
+        if worst_resp > rounded:
+            secs = int(worst_resp/1000)
+
+    perf.close()
+    print("\nDone Tables.\nTable data output to: performance_stats.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 pets_plots.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("Blockage-response-time.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())

+ 176 - 0
Parsing-results/raw_to_csv.py

@@ -0,0 +1,176 @@
+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
+        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("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 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 red:
+            redeem.close()
+        test_file.close()
+standard_check_file.close()
+print("Done.")

+ 15 - 0
Parsing-results/requirements.txt

@@ -0,0 +1,15 @@
+contourpy==1.0.5
+cycler==0.11.0
+fonttools==4.37.4
+kiwisolver==1.4.4
+matplotlib==3.6.1
+mercurial==5.6.1
+numpy==1.23.4
+packaging==21.3
+pandas==1.5.0
+Pillow==9.2.0
+pyparsing==3.0.9
+python-dateutil==2.8.2
+pytz==2022.4
+six==1.16.0
+

+ 86 - 0
Parsing-results/trust_promo.py

@@ -0,0 +1,86 @@
+log_file = open("trust_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())