mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
rename benchmarks for blog post
This commit is contained in:
@@ -39,22 +39,22 @@ class TestDC:
|
|||||||
ac1, ac2 = cmfactory.get_online_accounts(2)
|
ac1, ac2 = cmfactory.get_online_accounts(2)
|
||||||
chat = cmfactory.get_accepted_chat(ac1, ac2)
|
chat = cmfactory.get_accepted_chat(ac1, ac2)
|
||||||
|
|
||||||
def ping_pong():
|
def dc_ping_pong():
|
||||||
chat.send_text("ping")
|
chat.send_text("ping")
|
||||||
msg = ac2.wait_next_incoming_message()
|
msg = ac2.wait_next_incoming_message()
|
||||||
msg.chat.send_text("pong")
|
msg.chat.send_text("pong")
|
||||||
ac1.wait_next_incoming_message()
|
ac1.wait_next_incoming_message()
|
||||||
|
|
||||||
benchmark(ping_pong, 5)
|
benchmark(dc_ping_pong, 5)
|
||||||
|
|
||||||
def test_send_10_receive_10(self, benchmark, cmfactory, lp):
|
def test_send_10_receive_10(self, benchmark, cmfactory, lp):
|
||||||
ac1, ac2 = cmfactory.get_online_accounts(2)
|
ac1, ac2 = cmfactory.get_online_accounts(2)
|
||||||
chat = cmfactory.get_accepted_chat(ac1, ac2)
|
chat = cmfactory.get_accepted_chat(ac1, ac2)
|
||||||
|
|
||||||
def send_10_receive_10():
|
def dc_send_10_receive_10():
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
chat.send_text(f"hello {i}")
|
chat.send_text(f"hello {i}")
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
ac2.wait_next_incoming_message()
|
ac2.wait_next_incoming_message()
|
||||||
|
|
||||||
benchmark(send_10_receive_10, 5)
|
benchmark(dc_send_10_receive_10, 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user