From ce56fe33cb8aebdb1540fa75d7bcfa57e2af5b9a Mon Sep 17 00:00:00 2001 From: Sam Mirazi Date: Sun, 1 Jun 2025 21:54:44 -0700 Subject: [PATCH] Chore(benchmark): Reduce server keep-alive delay in benchmark table script This commit updates the `run_benchmark_table.py` script to shorten the keep-alive duration for web servers (FastAPI and Flask) after their respective benchmark tests complete and their pages are opened in the browser. Previously, the script would pause for 5 seconds to allow manual viewing of the opened page. This duration has been reduced to 2 seconds. Specific changes: - Modified the `time.sleep()` call from `time.sleep(5)` to `time.sleep(2)` within the main scenario loop. - Updated the corresponding console message `console.print(f"[blue]Keeping server alive for ... seconds to view the page...[/blue]")` to reflect the new 2-second delay. This change streamlines the benchmark execution process by reducing the waiting period, making the overall benchmarking cycle faster, while still allowing a brief moment to visually confirm the server's response. This refinement is part of ongoing efforts to optimize the benchmarking utilities. --- run_benchmark_table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_benchmark_table.py b/run_benchmark_table.py index 47e56dd..c8801b9 100644 --- a/run_benchmark_table.py +++ b/run_benchmark_table.py @@ -236,8 +236,8 @@ if __name__ == "__main__": try: console.print(f"[blue]Opening {sc['name']} page at {sc['url']} in browser...[/blue]") webbrowser.open(sc["url"]) - console.print(f"[blue]Keeping server alive for 5 seconds to view the page...[/blue]") - time.sleep(5) # Keep server alive for 5 seconds + console.print(f"[blue]Keeping server alive for 2 seconds to view the page...[/blue]") + time.sleep(2) # Keep server alive for 2 seconds except Exception as e: console.print(f"[yellow]Could not open browser for {sc['name']}: {e}[/yellow]") finally: -- 2.25.1