-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_benchmark.py
More file actions
35 lines (25 loc) · 945 Bytes
/
run_benchmark.py
File metadata and controls
35 lines (25 loc) · 945 Bytes
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
from threading import Thread
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend as crypto_default_backend
from providers.digitalocean import digitalocean_program
from providers.hetzner import hetzner_program
from providers.linode import linode_program
from benchmark import setup
from plot import show_plots
def main():
DATA = {}
key = rsa.generate_private_key(
backend=crypto_default_backend(), public_exponent=65537, key_size=2048
)
threads = [
Thread(target=setup, args=(DATA, "digitalocean", digitalocean_program(key))),
Thread(target=setup, args=(DATA, "hetzner", hetzner_program(key))),
Thread(target=setup, args=(DATA, "linode", linode_program(key))),
]
for thread in threads:
thread.start()
for thread in threads:
thread.join()
show_plots(DATA)
if __name__ == "__main__":
main()