瀏覽代碼

Adds iperf timeout for bandwith measurements.

master
Lukas Prause 3 年之前
父節點
當前提交
bcfc8e919c
共有 1 個檔案被更改,包括 10 行新增28 行删除
  1. +10
    -28
      measurement_main.py

+ 10
- 28
measurement_main.py 查看文件

@@ -370,17 +370,9 @@ class Server:
self.config["server"],
self.config["port"],
)
is_measurement_done = False
return_code = 0
while not is_measurement_done or return_code != 0:
try:
try:
return_code = subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
is_measurement_done = True
except:
print_message("iPerf timed out. Retry...")
except KeyboardInterrupt:
exit()

subprocess.call(iperf_command)

processHandler.kill_all()
congestion_control_index = (congestion_control_index + 1) % len(
tcp_algo
@@ -449,17 +441,9 @@ class Server:
str(self.config["port"]),
"--one-off",
]
is_measurement_done = False
return_code = 0
while not is_measurement_done or return_code != 0:
try:
try:
return_code= subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
is_measurement_done = True
except:
print_message("iPerf timed out. Retry...")
except KeyboardInterrupt:
exit()

subprocess.call(iperf_command)

sleep(2)
processHandler.kill_all()
congestion_control_index = (congestion_control_index + 1) % len(
@@ -823,11 +807,10 @@ class Client:
tcp_algo[congestion_control_index],
]
is_measurement_done = False
return_code = 0
while not is_measurement_done or return_code != 0:
while not is_measurement_done:
try:
try:
return_code = subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
is_measurement_done = True
except:
print_message("iPerf timed out. Retry...")
@@ -888,11 +871,10 @@ class Client:
)
sleep(2)
is_measurement_done = False
return_code = 0
while not is_measurement_done or return_code != 0:
while not is_measurement_done:
try:
try:
return_code = subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
is_measurement_done = True
except:
print_message("iPerf timed out. Retry...")

Loading…
取消
儲存