mirror of
https://github.com/chatmail/relay.git
synced 2026-05-18 08:58:57 +00:00
add a measurement for login/tls
This commit is contained in:
26
scripts/measure_tls_and_logins.py
Normal file
26
scripts/measure_tls_and_logins.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
|
import imaplib
|
||||||
|
|
||||||
|
NUM_CONNECTIONS=10
|
||||||
|
|
||||||
|
conns = []
|
||||||
|
|
||||||
|
start = time.time()
|
||||||
|
for i in range(NUM_CONNECTIONS):
|
||||||
|
print(f"opening connection {i}")
|
||||||
|
conn = imaplib.IMAP4_SSL("c3.testrun.org")
|
||||||
|
conns.append(conn)
|
||||||
|
|
||||||
|
tlsdone = time.time()
|
||||||
|
duration = tlsdone-start
|
||||||
|
print(f"{duration}: TLS connections opening TLS connections")
|
||||||
|
|
||||||
|
for i, conn in enumerate(conns):
|
||||||
|
print(f"logging into connection {i}")
|
||||||
|
conn.login(f"measure{i}", "pass")
|
||||||
|
|
||||||
|
logindone = time.time()
|
||||||
|
duration = logindone - tlsdone
|
||||||
|
print(f"{duration}: LOGINS done")
|
||||||
Reference in New Issue
Block a user