Commit fcfc7f70 by Sebastian Renner

Added support for splitting data into multiple plots

parent 32c851e3
......@@ -68,12 +68,26 @@ def read_log(d):
return (algorithm, dicts)
def gen_graph_chunks(bp_data, bp_labels, size):
l = len(bp_data)
for i in range(0, (l//size) * size, size):
chunk = bp_data[i:i+size]
labels = bp_labels[i:i+size]
plt.boxplot(chunk, labels=labels)
plt.xticks(rotation=90)
plt.show()
# Let's also plot the leftover
rest = l % size
if rest != 0:
plt.boxplot(bp_data[(rest-2*rest):])
plt.show()
def main():
print('THE LWC BENCHMARK SPLITTER')
print('powered by Deutsche Bahn')
build_dir = 'build/new/'
box_plot_data = []
box_plot_labels = []
bp_data = []
bp_labels = []
for d in os.listdir(build_dir):
#dicts[0] --> algo
#dicts[1][0] --> enc
......@@ -82,8 +96,8 @@ def main():
enc_values = dicts[1][0].values()
dec_values = dicts[1][1].values()
box_plot_data.append(list(enc_values))
box_plot_labels.append(dicts[0])
bp_data.append(list(enc_values))
bp_labels.append(dicts[0])
print("Average enc time[s] = %f" % (statistics.mean(enc_values)))
print("Median enc time[s] = %f" % (statistics.median(enc_values)))
......@@ -99,10 +113,11 @@ def main():
if dec_len != 1089 or enc_len != 1089:
raise Exception("#Number of encrypted test vectors (%d)/ decrypted test vectors (%d) does not match guidelines (1089)" % (enc_len, dec_len))
plt.boxplot(box_plot_data, labels=box_plot_labels)
plt.xticks(rotation=90)
plt.show()
gen_graph_chunks(bp_data, bp_labels, 5)
#plt.boxplot(bp_data, labels=bp_labels)
#plt.xticks(rotation=90)
#plt.show()
if __name__ == "__main__":
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment