Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 3.2 KB

File metadata and controls

58 lines (37 loc) · 3.2 KB

Here’s an updated, list-style index.md (in English) without any Tutorials section and with a clear pointer to the math details in the workload samplers.


AsyncFlow Documentation

AsyncFlow is a discrete-event simulator for Python async backends (FastAPI/Uvicorn–style). It builds a digital twin of your service—traffic, topology, and resources—so you can measure latency, throughput, queueing, RAM, and more before you deploy.

⚠️ The package README with pip install & a Quickstart will land after the first PyPI release.


Public API (stable surface)

  • High-Level API — The two entry points you’ll use most: AsyncFlow (builder) and SimulationRunner (orchestrator).
  • Components — Public Pydantic models for topology: Client, Server, Endpoint, Edge, LoadBalancer, NodesResources.
  • Workload — Traffic inputs: RqsGenerator and RVConfig (random variables).
  • Settings — Global controls: SimulationSettings (duration, sampling cadence, metrics).
  • Enums — Optional importable enums: distributions, step kinds/ops, metric names, node/edge types, LB algorithms.

How-to Guides

  • Builder Guide — Programmatically assemble a SimulationPayload in Python with validation and examples.
  • YAML Input Guide — Author scenarios in YAML: exact schema, units, constraints, runnable samples.
  • Dev workflow Guide — Describes the development workflow, repository architecture, branching strategy and CI/CD for AsyncFlow

Internals (design & rationale)

Prefer formal underpinnings? The Workload Samplers section includes mathematical details (compound Poisson–Poisson and Normal–Poisson processes, inverse-CDF gaps, truncated Gaussians).

  • Simulation Input (contract) — The complete SimulationPayload schema and all validation guarantees (graph integrity, step coherence, etc.).

  • Simulation Runner — Orchestrator design; build → wire → start → run flow; sequence diagrams; extensibility hooks.

  • Runtime & Resources — How CPU/RAM/DB are modeled with SimPy containers; decoupling of runtime logic and resources.

  • Metrics

    • Time-Series Architecture — Registry → runtime state → collector pipeline; why the if key in … guard keeps extensibility with zero hot-path cost.
  • Workload Samplers (math) — Formalization of traffic generators: windowed user resampling, rate construction $\Lambda = U \cdot \text{RPM}/60$, exponential inter-arrival via inverse-CDF, latency RV constraints.


Useful mental model

Every run boils down to this validated input:

SimulationPayload(
  rqs_input=RqsGenerator(...),        # workload
  topology_graph=TopologyGraph(...),  # nodes & edges
  sim_settings=SimulationSettings(...),
)

Build it (via Builder or YAML) and hand it to SimulationRunner to execute and analyze.