You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* new integration test + bug fixing
* added integration and unit test
* first tests working
* minor change
* first working example, upgrade docs, upgrade docstrings
* improvements
* path bug fixed
|**`config/`**| Centralised configuration layer. Contains Pydantic `BaseSettings` classes for reading environment variables and constants/enums used across the simulation engine. |
52
+
|**`metrics/`**| Post-processing and analytics. Aggregates raw simulation traces into KPIs such as latency percentiles, throughput, resource utilisation, and other performance metrics. |
53
+
|**`resources/`**| Runtime resource registry for simulated hardware components (e.g., SimPy `Container`s for CPU and RAM). Decouples resource management from actor behaviour. |
54
+
|**`runtime/`**| Core simulation engine. Orchestrates SimPy execution, maintains request state, and wires together simulation components. Includes: |
55
+
|| - **`rqs_state.py`** — Defines `RequestState` and `Hop` for tracking request lifecycle. |
56
+
|| - **`simulation_runner.py`** — Entry point for initialising and running simulations. |
57
+
|| - **`actors/`** — SimPy actor classes representing system components (`RqsGenerator`, `Client`, `Server`, `Edge`) and their behaviour. |
58
+
|**`samplers/`**| Random-variable samplers for stochastic simulation. Supports Poisson, Normal, and mixed distributions for modelling inter-arrival times and service steps. |
59
+
|**`schemas/`**| Pydantic models for input/output validation and serialisation. Includes scenario definitions, topology graphs, simulation settings, and results payloads. |
57
60
58
-
#### What each top-level directory in `src/app` does
|**`api/`**| Defines the public HTTP surface. Each module holds a router with path operations and dependency wiring. |
63
-
|**`config/`**| Centralised configuration: `settings.py` (Pydantic `BaseSettings`) reads env vars; `constants.py` stores enums and global literals. |
64
-
|**`db/`**| Persistence layer. Contains the SQLAlchemy base class, the session factory, and a thin wrapper that seeds or resets the database (Alembic migration scripts live at project root). |
65
-
|**`metrics/`**| Post-processing helpers that turn raw simulation traces into aggregated KPIs (latency percentiles, cost per request, utilisation curves, …). |
66
-
|**`resources/`**| A tiny run-time registry mapping every simulated server to its SimPy `Container`s (CPU, RAM). Keeps resource management separate from actor logic. |
67
-
|**`runtime/`**| The heart of the simulator. `rqs_state.py` holds the mutable `RequestState`; sub-package **`actors/`** contains each SimPy process class (Generator, Edge, Server, Client). |
68
-
|**`samplers/`**| Probability-distribution utilities that generate inter-arrival and service-time samples—used by the actors during simulation. |
69
-
|**`schemas/`**| All Pydantic models for validation and (de)serialisation: request DTOs, topology definitions, simulation settings, outputs. |
70
-
|**`main.py`**| Creates and returns the FastAPI app; imported by Uvicorn/Gunicorn. |
71
-
|**`simulation_run.py`**| Convenience script to launch a simulation offline (e.g. inside tests or CLI). |
63
+
### **Other Top-Level Directories**
72
64
73
-
Everything under `src/` is import-safe thanks to Poetry’s `packages = [{ include = "app" }]` entry in `pyproject.toml`.
|**`example/`**| Ready-to-run simulation scenarios and example configurations. Includes `data/` with YAML definitions and scripts to demonstrate engine usage. |
68
+
|**`scripts/`**| Utility shell scripts for development workflow, linting, formatting, and local startup (`quality-check.sh`, etc.). |
69
+
|**`docs/`**| Project documentation. Contains both high-level vision documents and low-level technical references (`fastsim-documentation/`). |
70
+
|**`tests/`**| Automated test suite, split into **unit** and **integration** tests to verify correctness of both individual components and end-to-end scenarios. |
74
71
72
+
---
75
73
76
74
## 3. Branching Strategy: Git Flow
77
75
@@ -182,21 +180,11 @@ We will start to describe the CI part related to push and PR in the develop bran
182
180
183
181
***Full Suite (push to `develop`)**
184
182
*Runs in a few minutes; includes real services and Docker.*
185
-
186
-
* All steps from the Quick Suite
187
-
* PostgreSQL service container started via `services:`
188
-
* Alembic migrations applied to the test database
183
+
189
184
* Full test suite, including `@pytest.mark.integration` tests
190
-
* Multi-stage Docker build of the backend image
191
-
* Smoke test: container started with Uvicorn → `curl /health`
185
+
192
186
193
187
194
-
### 4.1.3 Key Implementation Details
195
188
196
-
***Service containers** – PostgreSQL 17 is spun up in CI with a health-check to ensure migrations run against a live instance.
197
-
***Test markers** – integration tests are isolated with `@pytest.mark.integration`, enabling selective execution.
198
-
***Caching** – Poetry’s download cache is restored to cut installation time; Docker layer cache is reused between builds.
199
-
***Smoke test logic** – after the image is built, CI launches it in detached mode, polls the `/health` endpoint, prints logs, and stops the container. The job fails if the endpoint is unreachable.
200
-
***Secrets management** – database credentials and registry tokens are stored in GitHub Secrets and injected as environment variables only at runtime.
@@ -8,43 +8,151 @@ This document describes the design of the **requests generator**, which models a
8
8
9
9
Following the FastSim philosophy, we accept a small set of input parameters to drive a “what-if” analysis in a pre-production environment. These inputs let you explore reliability and cost implications under different traffic scenarios.
10
10
11
-
**Inputs**
11
+
## **Inputs**
12
12
13
-
1.**Average concurrent users** – expected number of users (or sessions) simultaneously hitting the endpoint.
14
-
2.**Average requests per minute per user** – average number of requests each user issues per minute.
15
-
3.**Simulation time** – total duration of the simulation, in seconds.
0 commit comments