add a measurement for login/tls

This commit is contained in:
holger krekel 2023-10-15 18:55:36 +02:00
parent b05154b818
commit a0e1d9e4d7
No known key found for this signature in database
GPG Key ID: 8E3B03A279B772D6

View 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")