Commit 5b3dc3ec authored by Andreas Schmidt's avatar Andreas Schmidt

update evaluation

parent 09774813
Pipeline #3169 passed with stages
in 1 minute and 50 seconds
......@@ -9,3 +9,4 @@ tests/__pycache__/
MANIFEST
prrt.cpython*.so
prrt.so
.ipynb_checkpoints/
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pd.read_csv(\"eval.csv\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
import sys
sys.path.insert(0, "./build")
import tests.perf as perf
def run_setup_and_report(setup):
results = setup.run()
print("Setup:\n ", setup)
print("Results:\n " + str(results).replace("\n","\n "))
results.export()
if __name__ == "__main__":
# Packet Count Works: 2^15; Segfault at: 2^16
# TODO: support multiple tests via proper socket termination
setups = [
perf.TestSetup(packets=2**17,delay=1,loss=0,reorder=0,duplicate=0)
]
for setup in setups:
run_setup_and_report(setup)
......@@ -65,7 +65,6 @@ PrrtSocket *PrrtSocket_create(prrtByteCount_t maximum_payload_size, prrtTimedelt
s->sequenceNumberRedundancy = 1;
s->sequenceNumberFeedback = 1;
check(target_delay_us < HALF_TIMESTAMP, "Specify target delay between 0 and %i", HALF_TIMESTAMP-1)
s->applicationConstraints = PrrtApplicationConstraints_create(target_delay_us);
......
......@@ -5,6 +5,7 @@ import datetime
import threading
import prrt
import numpy as np
import pandas as pd
import math
class ReceiverThread(threading.Thread):
......@@ -89,6 +90,13 @@ class TestResults(object):
return "%s\n%s\n%s\n%s" % (loss, duplicates, delays, losses)
def export(self):
df = pd.DataFrame({
"delays": self.delays
}, index=range(self.packetsSent))
df.to_csv("eval.csv")
class TestSetup(object):
def __init__(self, packets=20, packet_interval=0.0001, delay=1, delay_variation=0, delay_correlation=0, loss=0, loss_correlation=0, duplicate=0, reorder=0, reorder_correlation=0, loss_pattern=True):
self.packets = packets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment