fastapi-vs-flask/.git
3 weeks ago26
Sam Mirazi [Tue, 3 Jun 2025 19:50:33 +0000 (12:50 -0700)]
26

3 weeks ago25
Sam Mirazi [Tue, 3 Jun 2025 19:26:24 +0000 (12:26 -0700)]
25

3 weeks ago24
Sam Mirazi [Tue, 3 Jun 2025 19:22:43 +0000 (12:22 -0700)]
24

3 weeks agorequirements updated
Sam Mirazi [Tue, 3 Jun 2025 19:18:03 +0000 (12:18 -0700)]
requirements updated

3 weeks agoRefactor: Enhance Flask Application Logging for Clarity and Conciseness
Sam Mirazi [Tue, 3 Jun 2025 19:13:54 +0000 (12:13 -0700)]
Refactor: Enhance Flask Application Logging for Clarity and Conciseness

This commit refines the logging output of the Flask application (`app_flask/Flask_with_delay.py`) to improve readability and provide clearer status indicators during benchmark runs.

Two key changes were implemented:

1.  **Disable Werkzeug's Default Access Logs:**
    The standard Werkzeug request logger (which produces lines like `127.0.0.1 - - [timestamp] "GET / HTTP/1.1" 200 -`) has been disabled. This is achieved by getting the 'werkzeug' logger instance and setting its logging level to `ERROR`. This change significantly reduces log verbosity, allowing the custom application logs to be more prominent and easier to follow.

2.  **Add Explicit "OK" Confirmation to Custom Logs:**
    The custom log message printed by the Flask server upon successful request processing has been augmented with an " - OK" suffix. The log line now appears as `[Flask Server] Request {id} processed in {time}s - OK`. This provides an unambiguous visual confirmation that each request was handled successfully by the server, which is particularly useful when monitoring benchmark progress.

These modifications aim to make the Flask server's console output more focused and informative, aiding in the analysis of benchmark results by removing redundant log entries and clearly indicating successful operations.

3 weeks ago23
Sam Mirazi [Tue, 3 Jun 2025 19:05:36 +0000 (12:05 -0700)]
23

4 weeks agoZero-Failure
Sam Mirazi [Mon, 2 Jun 2025 05:49:36 +0000 (22:49 -0700)]
Zero-Failure

4 weeks ago22
Sam Mirazi [Mon, 2 Jun 2025 05:26:24 +0000 (22:26 -0700)]
22

4 weeks ago21
Sam Mirazi [Mon, 2 Jun 2025 05:24:04 +0000 (22:24 -0700)]
21

4 weeks ago20-core CPU
Sam Mirazi [Mon, 2 Jun 2025 05:15:41 +0000 (22:15 -0700)]
20-core CPU

4 weeks agoChore(benchmark): Reduce server keep-alive delay in benchmark table script
Sam Mirazi [Mon, 2 Jun 2025 04:54:44 +0000 (21:54 -0700)]
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.

4 weeks ago17
Sam Mirazi [Mon, 2 Jun 2025 04:51:00 +0000 (21:51 -0700)]
17

4 weeks ago16
Sam Mirazi [Mon, 2 Jun 2025 04:33:12 +0000 (21:33 -0700)]
16

4 weeks ago15
Sam Mirazi [Mon, 2 Jun 2025 04:30:08 +0000 (21:30 -0700)]
15

4 weeks agov14
Sam Mirazi [Mon, 2 Jun 2025 04:17:51 +0000 (21:17 -0700)]
v14

4 weeks agoTDD Updated
Sam Mirazi [Mon, 2 Jun 2025 03:58:55 +0000 (20:58 -0700)]
TDD Updated

4 weeks agov12
Sam Mirazi [Sun, 1 Jun 2025 18:49:05 +0000 (11:49 -0700)]
v12

4 weeks agoshow benchmark table -ok
Sam Mirazi [Sun, 1 Jun 2025 18:36:09 +0000 (11:36 -0700)]
show benchmark table -ok

4 weeks agofastAPI complete
Sam Mirazi [Sun, 1 Jun 2025 17:25:13 +0000 (10:25 -0700)]
fastAPI complete

4 weeks agoflask complete
Sam Mirazi [Sun, 1 Jun 2025 17:16:39 +0000 (10:16 -0700)]
flask complete

4 weeks ago11
Sam Mirazi [Sun, 1 Jun 2025 15:33:15 +0000 (08:33 -0700)]
11

4 weeks ago10
Sam Mirazi [Sun, 1 Jun 2025 07:03:34 +0000 (00:03 -0700)]
10

4 weeks agoEnd of phase 4
Sam Mirazi [Sun, 1 Jun 2025 06:53:33 +0000 (23:53 -0700)]
End of phase 4

4 weeks agodocs(TDD): Clarify FastAPI server execution and fix markdown for Phase 4
Sam Mirazi [Sun, 1 Jun 2025 06:49:27 +0000 (23:49 -0700)]
docs(TDD): Clarify FastAPI server execution and fix markdown for Phase 4

This commit enhances the Technical Design Document (Design Docs/TDD.md) by providing explicit instructions for running the FastAPI server, pertinent to the completion of Phase 4 ("Green Implementation for FastAPI"). It also includes a minor markdown syntax correction.

Key changes:
- Added a dedicated markdown block in Phase 4 with the precise command `uvicorn app_fastapi.app:app --host 127.0.0.1 --port 8000` and context for running the FastAPI application. This makes the instruction more prominent and user-friendly.
- Removed the previous, less visible comment `# Uvicorn will run this: uvicorn app_fastapi.app:app --port 8000` from within the FastAPI Python code example to avoid redundancy and improve clarity.
- Corrected markdown code block specifiers (from ``` to ````) around the FastAPI example and the new instruction block to ensure correct rendering of the document.

These changes make it easier for anyone following the TDD to manually start and test the FastAPI server as intended at the end of Phase 4, before proceeding to the benchmarking in Phase 5.

4 weeks ago9
Sam Mirazi [Sun, 1 Jun 2025 04:42:34 +0000 (21:42 -0700)]
9

4 weeks agostarting phase 4 -
Sam Mirazi [Sun, 1 Jun 2025 03:58:15 +0000 (20:58 -0700)]
starting phase 4 -

4 weeks ago8
Sam Mirazi [Sat, 31 May 2025 09:36:21 +0000 (02:36 -0700)]
8

4 weeks agophase 3 complete
Sam Mirazi [Sat, 31 May 2025 06:05:11 +0000 (23:05 -0700)]
phase 3 complete

4 weeks agofile name updated
Sam Mirazi [Sat, 31 May 2025 05:26:45 +0000 (22:26 -0700)]
file name updated

4 weeks agoapp_flask app.py auto launches browser and 3000
Sam Mirazi [Sat, 31 May 2025 05:22:22 +0000 (22:22 -0700)]
app_flask   app.py auto launches browser and 3000

4 weeks ago4
Sam Mirazi [Sat, 31 May 2025 05:15:19 +0000 (22:15 -0700)]
4

4 weeks agoInitialize project environment, dependencies, and Flask 'red' test.
Sam Mirazi [Sat, 31 May 2025 02:31:51 +0000 (19:31 -0700)]
Initialize project environment, dependencies, and Flask 'red' test.

This commit covers the successful completion of Phase 0 (Environment & Repo Skeleton) and Phase 1 (Red Test for Flask Home Route) as outlined in the Technical Design Document.

Key achievements include:

Phase 0:
- Successfully created and activated a Python virtual environment (.venv).
- Installed core project dependencies: Flask, FastAPI, Uvicorn, Pytest, HTTPX, and Requests.
- Corrected and finalized 'requirements.txt' to reflect these core dependencies with their specific versions.
- Scaffolded the initial project directory structure:
    - project/
        - app_flask/
        - app_fastapi/
        - tests/
        - benchmark/

Phase 1:
- Created the initial failing test file 'project/tests/test_flask_route.py'. This test is designed to fail (red state) as the Flask application endpoint is not yet implemented.
- Confirmed the expected 'red' test failure (httpx.ConnectError and ModuleNotFoundError for the non-existent app) by running the command:
  .\.venv\Scripts\python.exe -m pytest -p no:all
- Updated 'Design Docs/TDD.md' to include a detailed report of the Phase 1 verification, including the exact command used and the observed terminal output.

This establishes the baseline for Test-Driven Development, with a failing test now ready for the Flask application implementation in Phase 2.

4 weeks agorequirements file updated
Sam Mirazi [Sat, 31 May 2025 02:21:31 +0000 (19:21 -0700)]
requirements file updated

4 weeks agophase 0 - Complete
Sam Mirazi [Sat, 31 May 2025 02:12:47 +0000 (19:12 -0700)]
phase 0 - Complete