events and timeouts

This commit is contained in:
Jake Hillion 2020-12-12 17:15:09 +00:00
parent 1e3b0d7634
commit 23e13ad43c
4 changed files with 25 additions and 59 deletions

View File

@ -2,9 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"# Project Evaluation\n", "# Project Evaluation\n",
"\n", "\n",
@ -14,9 +12,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"## Setup\n", "## Setup\n",
"This section sets up the required variables for the Proxmox server." "This section sets up the required variables for the Proxmox server."
@ -46,9 +42,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"## Testing\n", "## Testing\n",
"This section gathers the required data from the different structures for later graphs." "This section gathers the required data from the different structures for later graphs."
@ -122,9 +116,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Direct Server to Server" "### Direct Server to Server"
] ]
@ -151,9 +143,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Local Portal with 2 Interfaces" "### Local Portal with 2 Interfaces"
] ]
@ -175,7 +165,7 @@
" run_and_save_test(env, StandardTest([2,2], bandwidth_variation_target=0.2 if fast_tests else 0.05))\n", " run_and_save_test(env, StandardTest([2,2], bandwidth_variation_target=0.2 if fast_tests else 0.05))\n",
" run_and_save_test(env, StandardTest(\n", " run_and_save_test(env, StandardTest(\n",
" [2,2],\n", " [2,2],\n",
" events={10: (0,1), 15: (0,2)},\n", " events={10: (0,1), 20: (0,2)},\n",
" duration=30,\n", " duration=30,\n",
" interval_variation_target=0.8 if fast_tests else 0.5,\n", " interval_variation_target=0.8 if fast_tests else 0.5,\n",
" ))\n", " ))\n",
@ -185,9 +175,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Local Portal with 3 Interfaces" "### Local Portal with 3 Interfaces"
] ]
@ -212,9 +200,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Local Portal with 4 Interfaces" "### Local Portal with 4 Interfaces"
] ]
@ -239,9 +225,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"## Graphs\n", "## Graphs\n",
"This section produces graphs from the collected data." "This section produces graphs from the collected data."
@ -269,9 +253,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Section 4.2: Graphs\n", "### Section 4.2: Graphs\n",
"#### Subsection 4.2.2 Line Graphs\n", "#### Subsection 4.2.2 Line Graphs\n",
@ -350,9 +332,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### More than 2 connections evaluation" "### More than 2 connections evaluation"
] ]
@ -401,9 +381,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Mixed Performance Evaluation" "### Mixed Performance Evaluation"
] ]
@ -431,9 +409,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Eventful Evaluation" "### Eventful Evaluation"
] ]
@ -459,9 +435,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Comparisons to a Direct Connection" "### Comparisons to a Direct Connection"
] ]
@ -554,9 +528,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Mixed Performance Evaluation" "### Mixed Performance Evaluation"
] ]
@ -584,9 +556,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Eventful Evaluation" "### Eventful Evaluation"
] ]
@ -612,9 +582,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": false
},
"source": [ "source": [
"### Comparisons to a Direct Connection" "### Comparisons to a Direct Connection"
] ]
@ -691,7 +659,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.6" "version": "3.9.0"
} }
}, },
"nbformat": 4, "nbformat": 4,

View File

@ -1,5 +1,5 @@
from itertools import cycle from itertools import cycle
from typing import Dict from typing import Dict, Union
from matplotlib import pyplot as plt from matplotlib import pyplot as plt

View File

@ -142,13 +142,13 @@ class ProxmoxRunner:
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor: with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
build_futures = [executor.submit(self._build_node, node) for node in nodes] build_futures = [executor.submit(self._build_node, node) for node in nodes]
for future in build_futures: for future in build_futures:
future.result() future.result(300)
# guarantee that setup is not called until all of the nodes are built # guarantee that setup is not called until all of the nodes are built
# this means that all will have their final IPs by this point # this means that all will have their final IPs by this point
setup_futures = [executor.submit(self._setup_node, node) for node in nodes] setup_futures = [executor.submit(self._setup_node, node) for node in nodes]
for future in setup_futures: for future in setup_futures:
future.result() future.result(300)
def _await_task(self, upid, timeout=10): def _await_task(self, upid, timeout=10):
t1 = datetime.now() t1 = datetime.now()

View File

@ -40,11 +40,9 @@ class BaseEnvironment:
rated_node.get_interfaces()[i].set_rate(r) rated_node.get_interfaces()[i].set_rate(r)
server.server() server.server()
for t, (iface, rate) in test.events.items(): for delay, (index, rate) in test.events.items():
threading.Timer( iface = rated_node.get_interfaces()[index]
6 + t, threading.Timer(6 + delay, iface.set_rate, args=[rate]).start()
(lambda n: lambda: n.get_interfaces()[iface].set_rate(rate))(rated_node),
)
iperf = client.client(server, time=test.duration) iperf = client.client(server, time=test.duration)
if old is None: if old is None:
@ -57,7 +55,7 @@ class BaseEnvironment:
if val.num_tests < 3: if val.num_tests < 3:
return False return False
return val.bandwidth_coefficient_variance() < test.bandwidth_variation_target and False not in \ return val.bandwidth_coefficient_variance() < test.bandwidth_variation_target and False not in \
[x < test.interval_variation_target for x in val.interval_coefficient_variances().values()] [x < test.interval_variation_target for x in val.interval_coefficient_variances().values()]
result = repeat_until_satisfied( result = repeat_until_satisfied(
test_reducer, test_reducer,