- Added ros_doublecheck_speed

- Adjusted config values
master
Nixellion 2020-06-27 23:23:20 +03:00
parent c33c637fd0
commit d2e5955d1d
3 changed files with 23 additions and 7 deletions

4
.gitignore vendored
View File

@ -137,3 +137,7 @@ test.png
data/database.db-shm data/database.db-shm
data/database.db-wal data/database.db-wal
test2.py test2.py
speeds.txt
test3.py
test4.py
speeds.txt

View File

@ -8,7 +8,9 @@ ros_queues:
ros_du_invert: False ros_du_invert: False
ros_fasttrack_comment: "defconf: fasttrack" ros_fasttrack_comment: "defconf: fasttrack"
# Minimum speed which not to cross, if speed is lower than this it will set this speed # Minimum speed which not to cross, if speed is lower than this it will set this speed
ros_minimum_speed: 300000 ros_minimum_speed: 100000
# If speed is lower than doublecheck_speed - run another test after a delay to make sure it was not an error
ros_doublecheck_speed: 300000
# Speed at which to leave fasttrack on. Use if your ROS device's CPU can't handle max speed you get, for example LHG LTE # Speed at which to leave fasttrack on. Use if your ROS device's CPU can't handle max speed you get, for example LHG LTE
# starts to show high CPU usage at close to 20mbit. # starts to show high CPU usage at close to 20mbit.
# Not implemented yet # Not implemented yet

View File

@ -194,12 +194,22 @@ def threaded_wan_speed():
def test_speed(): def test_speed():
sws = Thread(target=threaded_wan_speed) global wan_download
st = Thread(target=threaded_speedtest) tries = 2
st.start() for i in range(tries):
sws.start() sws = Thread(target=threaded_wan_speed)
st.join() st = Thread(target=threaded_speedtest)
sws.join() st.start()
sws.start()
st.join()
sws.join()
if wan_download >= config['ros_doublecheck_speed']:
break
else:
log.warning ("Speed is below ros_doublecheck_speed limit, retrying in a few seconds.")
time.sleep(10)
return
def generate_database_reports(): def generate_database_reports():