Skip to content

Commit d38d927

Browse files
authored
Add M/M/c (split) queue-theory analyzer, RANDOM load-balancer policy, and end-to-end comparison reports (#26)
* mmc split + notebook mmc split + random lb algo * tests for mmc
1 parent 722285e commit d38d927

File tree

8 files changed

+1793
-22
lines changed

8 files changed

+1793
-22
lines changed

asyncflow_queue_limit/asyncflow_mm1_notebook.ipynb renamed to asyncflow_queue_limit/asyncflow_mm1.ipynb

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,18 @@
9393
"\n",
9494
"```mermaid\n",
9595
"graph LR;\n",
96-
" %% Definiamo i nodi con i loro dettagli\n",
9796
" rqs1[\"<b>RqsGenerator</b><br/>id: rqs-1\"]\n",
9897
" client1[\"<b>Client</b><br/>id: client-1\"]\n",
9998
" app1[\"<b>Server</b><br/>id: app-1<br/>Endpoint: /api\"]\n",
10099
"\n",
101-
" %% Definiamo le connessioni (edge) con latenza\n",
102100
" rqs1 -- \"Edge: gen-client<br/>Latency: 0.0001\" --> client1;\n",
103101
" client1 -- \"Request<br/>Edge: client-app<br/>Latency: 0.0001\" --> app1;\n",
104102
" app1 -- \"Response<br/>Edge: app-client<br/>Latency: 0.0001\" --> client1;"
105103
]
106104
},
107105
{
108106
"cell_type": "code",
109-
"execution_count": 3,
107+
"execution_count": null,
110108
"metadata": {
111109
"tags": [
112110
"build"
@@ -148,7 +146,7 @@
148146
" e_app_client = Edge(id=\"app-client\", source=\"app-1\", target=\"client-1\", latency=0.0001, dropout_rate=0.0)\n",
149147
"\n",
150148
" settings = SimulationSettings(\n",
151-
" total_simulation_time=900,\n",
149+
" total_simulation_time=2400,\n",
152150
" sample_period_s=0.05,\n",
153151
" )\n",
154152
"\n",
@@ -160,9 +158,7 @@
160158
" .add_edges(e_gen_client, e_client_app, e_app_client)\n",
161159
" .add_simulation_settings(settings)\n",
162160
" ).build_payload()\n",
163-
" return payload\n",
164-
"\n",
165-
"payload = build_payload()\n"
161+
" return payload\n"
166162
]
167163
},
168164
{
@@ -174,7 +170,7 @@
174170
},
175171
{
176172
"cell_type": "code",
177-
"execution_count": 21,
173+
"execution_count": null,
178174
"metadata": {
179175
"tags": [
180176
"run"
@@ -190,6 +186,7 @@
190186
}
191187
],
192188
"source": [
189+
"payload = build_payload()\n",
193190
"env = simpy.Environment()\n",
194191
"runner = SimulationRunner(env=env, simulation_input=payload)\n",
195192
"results: ResultsAnalyzer = runner.run()\n",
@@ -306,7 +303,7 @@
306303
},
307304
{
308305
"cell_type": "code",
309-
"execution_count": 22,
306+
"execution_count": 28,
310307
"metadata": {
311308
"tags": [
312309
"mm1"
@@ -322,13 +319,13 @@
322319
"--------------------------------------------------------------------\n",
323320
"sym metric theory observed abs rel%\n",
324321
"--------------------------------------------------------------------\n",
325-
"λ Arrival rate (1/s) 33.333333 33.204444 -0.128889 -0.39\n",
326-
"μ Service rate (1/s) 66.666667 66.638004 -0.028663 -0.04\n",
327-
"rho Utilization 0.500000 0.498281 -0.001719 -0.34\n",
328-
"L Mean items in system 1.000000 1.034536 0.034536 3.45\n",
329-
"Lq Mean items in queue 0.500000 0.526294 0.026294 5.26\n",
330-
"W Mean time in system (s) 0.030000 0.031157 0.001157 3.86\n",
331-
"Wq Mean waiting time (s) 0.015000 0.015850 0.000850 5.67\n",
322+
"λ Arrival rate (1/s) 33.333333 33.150833 -0.182500 -0.55\n",
323+
"μ Service rate (1/s) 66.666667 66.556885 -0.109782 -0.16\n",
324+
"rho Utilization 0.500000 0.498083 -0.001917 -0.38\n",
325+
"L Mean items in system 1.000000 1.012994 0.012994 1.30\n",
326+
"Lq Mean items in queue 0.500000 0.504967 0.004967 0.99\n",
327+
"W Mean time in system (s) 0.030000 0.030557 0.000557 1.86\n",
328+
"Wq Mean waiting time (s) 0.015000 0.015232 0.000232 1.55\n",
332329
"====================================================================\n"
333330
]
334331
}

0 commit comments

Comments
 (0)