Repository navigation
Expand file tree
/
Copy pathplot.py
More file actions
117 lines (95 loc) · 3.14 KB
/
Copy pathplot.py
File metadata and controls
117 lines (95 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import numpy as np
import matplotlib.pyplot as plt
import re
import statistics
x = np.array([pow(2, 4), pow(2, 5), pow(2, 6), pow(
2, 7), pow(2, 8), pow(2, 9), pow(2, 10)])
################ Modify PATH to plot ################
FOLDER_PATH = "./19-04-2022-trial-1"
#####################################################
e2e_log = open(FOLDER_PATH+"/e2etime.log", "r")
upload_log = open(FOLDER_PATH+"/upload.log", "r")
verify_log = open(FOLDER_PATH+"/verify.log", "r")
e2e_time = e2e_time_std = upload_time = verify_time = verify_time_std = np.array([
])
for line in e2e_log.readlines():
line = line.strip()
if len(line) > 58:
# print(line)
result = re.findall("\d+\.\d+", line)
e2e_time = np.append(e2e_time, float(result[0]))
e2e_time_std = np.append(e2e_time_std, float(result[1]))
for line in upload_log.readlines():
line = line.strip()
if len(line) > 58:
average = float(re.findall("\d+\.\d+", line)[0])
upload_time = np.append(upload_time, average)
for line in verify_log.readlines():
line = line.strip()
if len(line) > 58:
result = re.findall("\d+\.\d+", line)
verify_time = np.append(verify_time, float(result[0]))
verify_time_std = np.append(verify_time_std, float(result[1]))
e2e_log.close()
upload_log.close()
verify_log.close()
# plt.title("issuing time diagram")
plt.ylabel("average time per certificate (second)")
plt.xlabel("number of certificate")
plt.xscale('log', base=2)
plt.plot(x, e2e_time, '-o')
plt.grid()
plt.ylim(0, 2.5)
plt.savefig(FOLDER_PATH + "/issuing-time-diagram.png")
plt.close()
plt.ylabel("std time per certificate (second)")
plt.xlabel("number of certificate")
plt.xscale('log', base=2)
plt.plot(x, e2e_time_std, '-o')
plt.grid()
plt.savefig(FOLDER_PATH + "/issuing-time-std-diagram.png")
plt.close()
# plt.title("upload time diagram")
plt.ylabel("total time (second)")
plt.xlabel("number of certificate")
plt.xscale('log', base=2)
plt.plot(x, upload_time, '-o')
plt.grid()
plt.ylim((0, 140))
plt.savefig(FOLDER_PATH + "/upload-time-diagram.png")
plt.close()
plt.ylabel("average upload time per certificate (second)")
plt.xlabel("number of certificate")
plt.xscale('log', base=2)
plt.plot(x, upload_time/x, '-o')
plt.grid()
plt.ylim((0, 0.3))
plt.savefig(FOLDER_PATH + "/upload-time-per-cert-diagram.png")
plt.close()
# plt.title("upload time diagram")
plt.ylabel("total time / second")
plt.xlabel("number of certificate")
# plt.xscale('log', base=2)
plt.plot(x, upload_time, '-o')
plt.grid()
plt.ylim((0, 140))
plt.savefig(FOLDER_PATH + "/upload-time-linear-diagram.png")
plt.close()
# plt.title("verify time diagram")
plt.ylabel("average verification time per certificate (second)")
plt.xlabel("number of certificate")
plt.plot(x, verify_time, '-o')
plt.xscale('log', base=2)
plt.ylim((0, 0.05))
plt.grid()
plt.savefig(FOLDER_PATH + "/verify-time-diagram.png")
plt.close()
# plt.title("verify time diagram")
plt.ylabel("std time per certificate (second)")
plt.xlabel("number of certificate")
plt.plot(x, verify_time_std, '-o')
plt.xscale('log', base=2)
plt.ylim((0, 0.01))
plt.grid()
plt.savefig(FOLDER_PATH + "/verify-time-std-diagram.png")
plt.close()