瀏覽代碼

Adds iperf timeout for bandwith measurements.

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

+ 12
- 8
measurement_main.py 查看文件

self.config["port"], self.config["port"],
) )
is_measurement_done = False is_measurement_done = False
while not is_measurement_done:
return_code = 0
while not is_measurement_done or return_code != 0:
try: try:
try: try:
subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
return_code = subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
is_measurement_done = True is_measurement_done = True
except: except:
print_message("iPerf timed out. Retry...") print_message("iPerf timed out. Retry...")
"--one-off", "--one-off",
] ]
is_measurement_done = False is_measurement_done = False
while not is_measurement_done:
return_code = 0
while not is_measurement_done or return_code != 0:
try: try:
try: try:
subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
return_code= subprocess.call(iperf_command, timeout=float(time) + 1.0 + TIMEOUT_OFFSET)
is_measurement_done = True is_measurement_done = True
except: except:
print_message("iPerf timed out. Retry...") print_message("iPerf timed out. Retry...")
tcp_algo[congestion_control_index], tcp_algo[congestion_control_index],
] ]
is_measurement_done = False is_measurement_done = False
while not is_measurement_done:
return_code = 0
while not is_measurement_done or return_code != 0:
try: try:
try: try:
subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
return_code = subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
is_measurement_done = True is_measurement_done = True
except: except:
print_message("iPerf timed out. Retry...") print_message("iPerf timed out. Retry...")
) )
sleep(2) sleep(2)
is_measurement_done = False is_measurement_done = False
while not is_measurement_done:
return_code = 0
while not is_measurement_done or return_code != 0:
try: try:
try: try:
subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
return_code = subprocess.call(iperf_command, timeout=float(time) + 2.0 + TIMEOUT_OFFSET)
is_measurement_done = True is_measurement_done = True
except: except:
print_message("iPerf timed out. Retry...") print_message("iPerf timed out. Retry...")

Loading…
取消
儲存