diff --git a/.gitignore b/.gitignore index d545316..cd6c811 100644 --- a/.gitignore +++ b/.gitignore @@ -142,3 +142,4 @@ test3.py test4.py speeds.txt *.png +config/dash_data.yaml diff --git a/config/config.yaml b/config/config.yaml index 4c74785..4f5275e 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -11,6 +11,7 @@ ros_fasttrack_comment: 'defconf: fasttrack' ros_ip: 192.168.88.1 ros_maximum_speed: 15000000 ros_minimum_speed: 100000 +speedtest_threads: 4 ros_queues: - queue1 ros_queues_except: diff --git a/speedtester.py b/speedtester.py index 577e04b..b7b63a2 100644 --- a/speedtester.py +++ b/speedtester.py @@ -355,15 +355,28 @@ def threaded_wan_speed(): log.info(f"Monitor result: {mbits(wan_download)} mbps; {mbits(wan_upload)} mbps;") -def test_speed(): +def test_speed(parallel=2): global wan_download reset_globals() + sws = Thread(target=threaded_wan_speed) - st = Thread(target=threaded_speedtest) - st.start() + + tests = [] + for test in range(parallel): + t = Thread(target=threaded_speedtest) + tests.append(t) + log.info(f"Starting test thread {test}...") + t.start() + + log.info("Starting monitoring thread...") sws.start() - st.join() + + for i, test in enumerate(tests): + test.join() + log.info(f"Test thread {i} finished.") + sws.join() + log.info(f"Monitoring thread finished.") return @@ -463,7 +476,7 @@ if __name__ == "__main__": ros_unlimited_speed() # Thats 4096 Megabits adjust if you got more... time.sleep(5) - test_speed() + test_speed(config['speedtest_threads']) if speedtest_failed: on_fail_or_no_connection()