Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support to rank and output RebornOS mirrors #8

Merged
merged 4 commits into from Jul 15, 2021

Conversation

pvshvp-oss
Copy link
Contributor

Currently the RebornOS community uses a mirrorlist file, but that does not provide satisfactory performance to all users, because they are not ranked based on individuals' networks.

This pull request adds support for ranking RebornOS' mirrors. RebornOS currently has a text-based mirrorlist in our Gitlab organization that we update regularly. The additions in this code will fetch the mirrorlist file, extract only the URLs, and submit them to the application for ranking. The output is of the standard format used in the Arch Linux mirrorlist.

Thanks for giving me the opportunity to work on this addition 馃檪

@pvshvp-oss
Copy link
Contributor Author

Here is a sample output:

[user@user debug]$ ./rate_mirrors --protocol="http" rebornos
# STARTED AT: 2021-07-14 23:54:30.783793421 -05:00
# ARGS: ./rate_mirrors --protocol=http rebornos
# FETCHED 20 MIRRORS FROM REBORNOS
# JUMP #1
# EXPLORING US
# VISITED US
# BLANK ITERATION
# 

# TESTING MIRRORS WITH UNKNOWN COUNTRIES
# SpeedTestResult { speed: 230.01 KB/s; elapsed: 492.546222ms; connection_time: 978.713959ms}
# SpeedTestResult { speed: 494.70 KB/s; elapsed: 1.32837881s; connection_time: 167.606763ms}
# SpeedTestResult { speed: 2.25 MB/s; elapsed: 1.287050533s; connection_time: 209.094632ms}
# SpeedTestResult { speed: 1.36 MB/s; elapsed: 687.565278ms; connection_time: 488.498522ms}
# SpeedTestResult { speed: 373.52 KB/s; elapsed: 566.489596ms; connection_time: 876.696714ms}
# SpeedTestResult { speed: 320.14 KB/s; elapsed: 353.885353ms; connection_time: 977.972885ms}
# SpeedTestResult { speed: 912.50 KB/s; elapsed: 970.454311ms; connection_time: 525.253633ms}
# SpeedTestResult { speed: 807.88 KB/s; elapsed: 119.954021ms; connection_time: 1.301459642s}
# SpeedTestResult { speed: 1.78 MB/s; elapsed: 1.169052026s; connection_time: 292.124743ms}
# 

# RE-TESTING TOP MIRRORS
# SpeedTestResult { speed: 2.79 MB/s; elapsed: 1.255493346s; connection_time: 161.756246ms}
# SpeedTestResult { speed: 1.89 MB/s; elapsed: 1.323367615s; connection_time: 176.360912ms}
# SpeedTestResult { speed: 2.56 MB/s; elapsed: 961.346934ms; connection_time: 533.064083ms}
# SpeedTestResult { speed: 1.07 MB/s; elapsed: 315.343596ms; connection_time: 1.119318082s}
# SpeedTestResult { speed: 1.24 MB/s; elapsed: 1.093524365s; connection_time: 379.107089ms}
# ==== RESULTS (top re-tested) ====
#   1. SpeedTestResult { speed: 2.79 MB/s; elapsed: 1.255493346s; connection_time: 161.756246ms} -> http://osdn.mirror.constant.com/storage/g/r/re/rebornos/repo/RebornOS/
#   2. SpeedTestResult { speed: 2.56 MB/s; elapsed: 961.346934ms; connection_time: 533.064083ms} -> http://downloads.sourceforge.net/rebornos/r/RebornOS/
#   3. SpeedTestResult { speed: 1.89 MB/s; elapsed: 1.323367615s; connection_time: 176.360912ms} -> http://sourceforge.mirror.iweb.com/project/rebornos/r/RebornOS/
#   4. SpeedTestResult { speed: 1.24 MB/s; elapsed: 1.093524365s; connection_time: 379.107089ms} -> http://mirror.arctic.lol/RebornMirror/
#   5. SpeedTestResult { speed: 1.07 MB/s; elapsed: 315.343596ms; connection_time: 1.119318082s} -> http://tenet.dl.sourceforge.net/project/rebornos/r/RebornOS/
#   6. SpeedTestResult { speed: 494.70 KB/s; elapsed: 1.32837881s; connection_time: 167.606763ms} -> http://mirror.math.princeton.edu/pub/osdn/storage/g/r/re/rebornos/repo/RebornOS/
#   7. SpeedTestResult { speed: 373.52 KB/s; elapsed: 566.489596ms; connection_time: 876.696714ms} -> http://cfhcable.dl.sourceforge.net/sourceforge/rebornos/r/RebornOS/
#   8. SpeedTestResult { speed: 320.14 KB/s; elapsed: 353.885353ms; connection_time: 977.972885ms} -> http://netcologne.dl.sourceforge.net/sourceforge/rebornos/r/RebornOS
#   9. SpeedTestResult { speed: 230.01 KB/s; elapsed: 492.546222ms; connection_time: 978.713959ms} -> http://newcontinuum.dl.sourceforge.net/sourceforge/rebornos/r/RebornOS/
# FINISHED AT: 2021-07-14 23:54:43.088970818 -05:00
Server = http://osdn.mirror.constant.com/storage/g/r/re/rebornos/repo/RebornOS/
Server = http://downloads.sourceforge.net/rebornos/r/RebornOS/
Server = http://sourceforge.mirror.iweb.com/project/rebornos/r/RebornOS/
Server = http://mirror.arctic.lol/RebornMirror/
Server = http://tenet.dl.sourceforge.net/project/rebornos/r/RebornOS/
Server = http://mirror.math.princeton.edu/pub/osdn/storage/g/r/re/rebornos/repo/RebornOS/
Server = http://cfhcable.dl.sourceforge.net/sourceforge/rebornos/r/RebornOS/
Server = http://netcologne.dl.sourceforge.net/sourceforge/rebornos/r/RebornOS
Server = http://newcontinuum.dl.sourceforge.net/sourceforge/rebornos/r/RebornOS/

@westandskif
Copy link
Owner

Thank you! I'm merging this and will make the following changes in a few minutes:

  1. drop regex-related comments in src/targets/rebornos.rs
  2. drop same as for arch lines from README as these seem repeatitive

@westandskif westandskif merged commit e99422a into westandskif:master Jul 15, 2021
@westandskif
Copy link
Owner

Have just released 2 versions to AUR now - https://aur.archlinux.org/packages/?O=0&SeB=nd&K=rate-mirrors&outdated=&SB=n&SO=a&PP=50&do_Search=Go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants