Commit bf2573f9 authored by rna's avatar rna Committed by Andreas Schmidt

Improve eval scripts.

parent df8f2d41
......@@ -36,7 +36,7 @@ class ReceiverThread(threading.Thread):
class SenderThread(threading.Thread):
def __init__(self, seqnoDigits, packetCount):
threading.Thread.__init__(self)
self.sock = prrt.PrrtSocket(7005, True, 0.1)
self.sock = prrt.PrrtSocket(7005, True, 1)
self.packetCount = packetCount
self.seqnoDigits = seqnoDigits
......@@ -91,11 +91,11 @@ class TestSetup(object):
self.duplicate = duplicate
self.reorder = reorder
self.reorder_correlation = reorder_correlation
self.processing_delay = 0.00001 # in ms
self.processing_delay = 0.0001 # in ms
def netem_config(self):
# http://www.linuxfoundation.org/collaborate/workgroups/networking/netem
return "delay %dms %dms %d%% loss %f%% %f%% duplicate %f%% reorder %f%% %f%%" % (
return "delay %dus %dus %d%% loss %f%% %f%% duplicate %f%% reorder %f%% %f%%" % (
self.delay, self.delay_variation, self.delay_correlation, self.loss, self.loss_correlation,
self.duplicate, self.reorder, self.reorder_correlation)
......@@ -111,13 +111,13 @@ class TestSetup(object):
recvThread.start()
sendThread.run()
time.sleep(1 + self.packets * (self.delay / 1000 + self.processing_delay))
time.sleep(1)
#time.sleep(1 + self.packets * (self.delay / (1000**2) + self.processing_delay))
count = len(recvThread.received)
delays = np.ndarray((self.packets),dtype="float")
for i in range(self.packets):
item = (recvThread.receivedPackets[i] - sendThread.sentPackets[i]).item()
delays[i] = item.total_seconds() if item is not None else np.NAN
diffs = map(lambda x: x.item().total_seconds() if x.item() is not None else np.NAN,
(recvThread.receivedPackets - sendThread.sentPackets))
delays = np.fromiter(diffs, dtype="float")
subprocess.run("tc qdisc del dev lo root", shell=True, check=True)
......
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