Skip to content

Commit 0098453

Browse files
authored
Refactor/change project name plus docs improvement (#13)
* Changed name from fastsim to asyncflow app folder renamed in asyncflow * improved docs
1 parent 2a306ac commit 0098453

File tree

74 files changed

+1300
-746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1300
-746
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# **FastSim – Event-Loop Aware Simulation for Backend Systems**
1+
# **AsyncFlow – Event-Loop Aware Simulation for Backend Systems**
22

33
## **1. Overview**
44

55
Modern asynchronous Python stacks such as **FastAPI + Uvicorn** deliver impressive performance, yet capacity planning for production workloads often relies on guesswork, costly cloud-based load tests, or late-stage troubleshooting.
66

7-
**FastSim** addresses this challenge by providing a **digital twin** of your service that can be run entirely offline. It models event-loop behaviour, resource constraints, and request lifecycles, enabling you to forecast performance under different workloads and architectural choices **before deployment**.
7+
**AsyncFlow** addresses this challenge by providing a **digital twin** of your service that can be run entirely offline. It models event-loop behaviour, resource constraints, and request lifecycles, enabling you to forecast performance under different workloads and architectural choices **before deployment**.
88

9-
FastSim allows you to answer questions such as:
9+
AsyncFlow allows you to answer questions such as:
1010

1111
* *What happens to p95 latency if traffic doubles during a peak event?*
1212
* *How many cores are required to maintain SLAs at scale?*
@@ -37,7 +37,7 @@ Until published, clone the repository and install in editable mode:
3737
- Python 3.11+ (recommended 3.12)
3838
- Poetry ≥ 1.6
3939

40-
FastSim uses [Poetry](https://python-poetry.org/) for dependency management.
40+
AsyncFlow uses [Poetry](https://python-poetry.org/) for dependency management.
4141
If you do not have Poetry installed, follow these steps.
4242

4343
### 3.1 Install Poetry (official method)
@@ -64,8 +64,8 @@ curl -sSL https://install.python-poetry.org | python3 -
6464

6565
```bash
6666
# Clone the repository
67-
git clone https://github.com/GioeleB00/Fastsim-Backend.git
68-
cd Fastsim-Backend
67+
git clone https://github.com/GioeleB00/AsyncFlow-Backend.git
68+
cd AsyncFlow-Backend
6969

7070
# Configure Poetry to always create a local `.venv` inside the project
7171
poetry config virtualenvs.in-project true
@@ -171,9 +171,9 @@ from pathlib import Path
171171
import simpy
172172
import matplotlib.pyplot as plt
173173
174-
from app.config.constants import LatencyKey
175-
from app.runtime.simulation_runner import SimulationRunner
176-
from app.metrics.analyzer import ResultsAnalyzer
174+
from asyncflow.config.constants import LatencyKey
175+
from asyncflow.runtime.simulation_runner import SimulationRunner
176+
from asyncflow.metrics.analyzer import ResultsAnalyzer
177177
178178
def print_latency_stats(res: ResultsAnalyzer) -> None:
179179
"""Print latency statistics returned by the analyzer."""
@@ -229,7 +229,7 @@ you will see the latency stats
229229

230230
## **5. Target Users and Use Cases**
231231

232-
| Audience | Challenge | FastSim Value |
232+
| Audience | Challenge | AsyncFlow Value |
233233
| ------------------------ | ------------------------------------------------- | -------------------------------------------------------------------------------- |
234234
| Backend Engineers | Sizing services for variable workloads | Model endpoint workflows and resource bottlenecks before deployment |
235235
| DevOps / SRE | Balancing cost and SLA | Simulate scaling scenarios to choose optimal capacity |
@@ -244,7 +244,7 @@ you will see the latency stats
244244
The project follows a standard Python package layout, managed with Poetry.
245245

246246
```
247-
Fastsim-Backend/
247+
AsyncFlow-Backend/
248248
├── examples/ # Examples payloads and datasets
249249
├── scripts/ # Utility scripts (linting, startup)
250250
├── docs/ # Project vision and technical documentation
@@ -265,7 +265,7 @@ Fastsim-Backend/
265265

266266
## **7. Development Workflow**
267267

268-
FastSim uses **Poetry** for dependency management and enforces quality via **Ruff** and **MyPy**.
268+
AsyncFlow uses **Poetry** for dependency management and enforces quality via **Ruff** and **MyPy**.
269269

270270
| Task | Command | Description |
271271
| ------------- | --------------------------------- | -------------------------------------- |

docs/dev_workflow_guide.md

Lines changed: 125 additions & 60 deletions
Large diffs are not rendered by default.

docs/fastsim-docs/metrics_to_measure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
### **FastSim — Simulation Metrics**
1+
### **AsyncFlow — Simulation Metrics**
22

3-
Metrics are the lifeblood of any simulation, transforming a series of abstract events into concrete, actionable insights about system performance, resource utilization, and potential bottlenecks. FastSim provides a flexible and robust metrics collection system designed to give you a multi-faceted view of your system's behavior under load.
3+
Metrics are the lifeblood of any simulation, transforming a series of abstract events into concrete, actionable insights about system performance, resource utilization, and potential bottlenecks. AsyncFlow provides a flexible and robust metrics collection system designed to give you a multi-faceted view of your system's behavior under load.
44

5-
To achieve this, FastSim categorizes metrics into three distinct types:
5+
To achieve this, AsyncFlow categorizes metrics into three distinct types:
66

77
1. **Sampled Metrics (`SampledMetricName`):** These metrics provide a **time-series view** of the system's state. They are captured at fixed, regular intervals (e.g., every 5 milliseconds). This methodology is ideal for understanding trends and measuring the continuous utilization of finite resources. Think of them as periodic snapshots of your system's health.
88

docs/fastsim-docs/requests_generator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This document describes the design of the **requests generator**, which models a
66

77
## Model Inputs and Output
88

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.
9+
Following the AsyncFlow 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.
1010

1111
## **Inputs**
1212

@@ -386,4 +386,4 @@ The sampling window length governs how often we re-sample $U$. It should reflect
386386

387387

388388
**Key takeaway:** By structuring the generator as
389-
$\Lambda = U\,\lambda_r/60$ with a two-stage Poisson→Exponential sampler, FastSim efficiently reproduces compound Poisson traffic dynamics without any complex CDF inversion.
389+
$\Lambda = U\,\lambda_r/60$ with a two-stage Poisson→Exponential sampler, AsyncFlow efficiently reproduces compound Poisson traffic dynamics without any complex CDF inversion.

docs/fastsim-docs/runtime_and_resources.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Of course. This is an excellent request. A deep dive into the "why" and the real-world analogies is what makes documentation truly valuable.
22

3-
Here is the comprehensive, detailed documentation for the FastSim Runtime Layer, written in English, incorporating all your requests.
3+
Here is the comprehensive, detailed documentation for the AsyncFlow Runtime Layer, written in English, incorporating all your requests.
44

55
-----
66

7-
# **FastSim — The Runtime Layer Documentation**
7+
# **AsyncFlow — The Runtime Layer Documentation**
88

99
*(Version July 2025 – Aligned with `app/runtime` and `app/resources`)*
1010

@@ -80,7 +80,7 @@ Think of `RequestState` as a request context in a modern microservices architect
8080
## **4 The Resource Layer — Modelling Contention ⚙️**
8181

8282
In real infrastructures every machine has a hard ceiling: only *N* CPU cores, only *M* MB of RAM.
83-
FastSim mirrors that physical constraint through the **Resource layer**, which exposes pre-filled SimPy containers that actors must draw from. If a token is not available the coroutine simply blocks — giving you back-pressure “for free”.
83+
AsyncFlow mirrors that physical constraint through the **Resource layer**, which exposes pre-filled SimPy containers that actors must draw from. If a token is not available the coroutine simply blocks — giving you back-pressure “for free”.
8484

8585
---
8686

@@ -127,7 +127,7 @@ defensive checks beyond the simple dictionary lookup.
127127
| RAM container tokens | **cgroup memory limit** or a pod’s allocatable memory; once exhausted new workloads must wait. |
128128

129129
Just like a Kubernetes scheduler won’t place a pod if a node lacks free CPU/RAM,
130-
FastSim won’t let an actor proceed until it obtains the necessary tokens.
130+
AsyncFlow won’t let an actor proceed until it obtains the necessary tokens.
131131

132132
## **5. The Actors: Bringing the System to Life**
133133

@@ -448,4 +448,4 @@ def _forwarder(self) -> Generator[simpy.Event, None, None]:
448448

449449
With these mechanics the `LoadBalancerRuntime` faithfully emulates behaviour of
450450
production LBs (NGINX, HAProxy, AWS ALB) while remaining lightweight and
451-
fully deterministic inside the FastSim event loop.
451+
fully deterministic inside the AsyncFlow event loop.

0 commit comments

Comments
 (0)