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