From 4f735008ba5390b75dd031f1337361410caa3212 Mon Sep 17 00:00:00 2001 From: marcsello Date: Fri, 23 Oct 2020 03:52:09 +0200 Subject: [PATCH] added more messages --- benchmark3.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/benchmark3.py b/benchmark3.py index af3f745..347ee5f 100644 --- a/benchmark3.py +++ b/benchmark3.py @@ -182,12 +182,16 @@ def main(): total_successful_uploads = len([req for req in benchmark_results.values() if req.upload_status_code == 200]) all_arrived = False - for _ in range(int(args.inflight_timeout)): - time.sleep(1) + waiting_started = time.time() + for _ in range(int(args.inflight_timeout*1000)): if alerts_arrived_queue.qsize() >= total_successful_uploads: all_arrived = True break + time.sleep(0.001) + waited_for_inflight = time.time() - waiting_started + print(f"Waited a total {waited_for_inflight} seconds") + if not all_arrived: print("WARNING: Not all MQTT Messages arrived!")