Skip to content

Commit b22f1e2

Browse files
authored
New Api RqsGenerator ---> ArrivalsGenerator (#27)
* changing api per ArrivalsGenerator and implementing distrib for ArrivalRuntime * Reafctoring API Arrival generator, tests integrations now working * Api Arrival generator migration complete with tests
1 parent d38d927 commit b22f1e2

File tree

143 files changed

+2605
-4684
lines changed

Some content is hidden

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

143 files changed

+2605
-4684
lines changed

asyncflow_queue_limit/asyncflow_mm1.ipynb

Lines changed: 66 additions & 56 deletions
Large diffs are not rendered by default.

asyncflow_queue_limit/asyncflow_mmc_split.ipynb

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,33 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": 3,
23+
"execution_count": null,
2424
"id": "b8a94d93",
2525
"metadata": {},
2626
"outputs": [],
2727
"source": [
2828
"import sys, importlib\n",
2929
"\n",
30-
"# 1) Svuota tutto ciò che inizia con 'asyncflow' da sys.modules\n",
30+
"\n",
3131
"for m in list(sys.modules):\n",
3232
" if m.startswith(\"asyncflow\"):\n",
3333
" del sys.modules[m]\n",
3434
"\n",
35-
"# 2) Re-importa SOLO le facciate pubbliche (niente import profondi)\n",
35+
"\n",
3636
"from asyncflow import AsyncFlow, SimulationRunner\n",
3737
"from asyncflow.analysis import MMc, ResultsAnalyzer\n",
3838
"from asyncflow.components import (\n",
39-
" Client, Server, Edge, Endpoint, LoadBalancer\n",
39+
" Client, Server, Edge, Endpoint, LoadBalancer, ArrivalsGenerator\n",
4040
")\n",
4141
"from asyncflow.settings import SimulationSettings\n",
42-
"from asyncflow.workload import RqsGenerator\n",
42+
"\n",
4343
"import simpy\n",
4444
"\n"
4545
]
4646
},
4747
{
4848
"cell_type": "code",
49-
"execution_count": 4,
49+
"execution_count": null,
5050
"id": "d1b7ad7d",
5151
"metadata": {},
5252
"outputs": [
@@ -64,10 +64,10 @@
6464
"\n",
6565
"# Public AsyncFlow API\n",
6666
"from asyncflow import AsyncFlow, SimulationRunner, Sweep\n",
67-
"from asyncflow.components import Client, Server, Edge, Endpoint, LoadBalancer\n",
67+
"from asyncflow.components import Client, Server, Edge, Endpoint, LoadBalancer, ArrivalsGenerator\n",
6868
"from asyncflow.settings import SimulationSettings\n",
69-
"from asyncflow.workload import RqsGenerator\n",
70-
"from asyncflow.analysis import MM1, ResultsAnalyzer, SweepAnalyzer, MMc\n",
69+
"from asyncflow.analysis import ResultsAnalyzer, SweepAnalyzer, MMc\n",
70+
"from asyncflow.enums import Distribution\n",
7171
"\n",
7272
"print(\"Imports OK.\")"
7373
]
@@ -128,17 +128,16 @@
128128
},
129129
{
130130
"cell_type": "code",
131-
"execution_count": 5,
131+
"execution_count": null,
132132
"id": "ba93587a",
133133
"metadata": {},
134134
"outputs": [],
135135
"source": [
136136
"def build_payload():\n",
137-
" generator = RqsGenerator(\n",
137+
" generator = ArrivalsGenerator(\n",
138138
" id=\"rqs-1\",\n",
139-
" avg_active_users={\"mean\": 120},\n",
140-
" avg_request_per_minute_per_user={\"mean\": 20},\n",
141-
" user_sampling_window=60,\n",
139+
" lambda_rps=30,\n",
140+
" model=Distribution.POISSON\n",
142141
" )\n",
143142
"\n",
144143
" client = Client(id=\"client-1\")\n",
@@ -189,7 +188,7 @@
189188
"\n",
190189
" payload = (\n",
191190
" AsyncFlow()\n",
192-
" .add_generator(generator)\n",
191+
" .add_arrivals_generator(generator)\n",
193192
" .add_client(client)\n",
194193
" .add_servers(srv1, srv2)\n",
195194
" .add_load_balancer(lb)\n",

examples/builder_input/event_injection/lb_two_servers.py

Lines changed: 0 additions & 240 deletions
This file was deleted.

0 commit comments

Comments
 (0)