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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download URL used for speedtest does not support prerelease Fedora versions #1

Open
teohhanhui opened this issue Mar 12, 2023 · 8 comments

Comments

@teohhanhui
Copy link

url = f"{link}/releases/{ostm}/Everything/{archi}/os/images/efiboot.img"

@fardinkamal62
Copy link
Owner

Hi,
Thank you for using this script😊

I've tested myself using Fedora 37 with aarch64 architecture. And it seems working fine.
Can you please check once again and give me a screenshot

@teohhanhui
Copy link
Author

teohhanhui commented Mar 12, 2023

Mm... Actually it's because I'm on Fedora 38 😅

Looks like the same file for prerelease versions can be found under development instead of releases.

@teohhanhui teohhanhui changed the title Download URL used for speedtest does not exist for aarch64 Download URL used for speedtest does not support prerelease Fedora versions Mar 12, 2023
@fardinkamal62
Copy link
Owner

Thanks for clarifying!
I've fixed the issue and will push with some other changes

@teohhanhui
Copy link
Author

I think there's still something wrong, but I'm not familiar with Python format strings, so... Here's the output I get:

Checking Japan mirrors: ['http://ftp.riken.jp/Linux/fedora', 'https://ftp.riken.jp/Linux/fedora', 'https://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/fedora/linux', 'http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/fedora/linux']

http://ftp.riken.jp/Linux/fedora [==============================] 1.294 Kbps

https://ftp.riken.jp/Linux/fedora [==============================] 0.6 Kbps

https://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/fedora/linux [==============================] 0.445 Kbps

http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/fedora/linux [==============================] 0.632 Kbps

Those speeds are impossibly low, and combined with the fact that they complete incredibly fast, I don't think it's downloading the efiboot.img file itself...

@teohhanhui
Copy link
Author

Oh, also I've noticed Content-Length header is in bytes, and your unit is Kbps, so it should be divided by (1000 / 8)

But usually other tools (such as dnf) show the speed in KiB/s, so just no. of bytes divided by 1024

@teohhanhui
Copy link
Author

Here's my dnf output for comparison:

[teohhanhui@han-macbook-air ~]$ sudo dnf5 upgrade
Updating and loading repositories:
 Copr repo for kernel-edge owned by @as 100% |   2.3 KiB/s |   3.3 KiB |  00m01s
 Copr repo for kernel-edge owned by @as 100% |   1.1 MiB/s | 993.9 KiB |  00m01s
 Fedora Modular 38 - aarch64 - Test Upd 100% |   2.3 KiB/s |   3.4 KiB |  00m01s
 Copr repo for u-boot owned by @asahi   100% |   6.5 KiB/s |   3.3 KiB |  00m01s
 Fedora Modular 38 - aarch64            100% |   3.0 KiB/s |   3.6 KiB |  00m01s
 Fedora Modular 38 - aarch64            100% |  54.4 KiB/s | 200.7 KiB |  00m04s
 Fedora Modular 38 - aarch64 - Updates  100% |   3.3 KiB/s |   4.3 KiB |  00m01s
 Copr repo for mesa owned by @asahi     100% |   2.9 KiB/s |   3.3 KiB |  00m01s
 Copr repo for mesa owned by @asahi     100% |  13.1 KiB/s |  11.0 KiB |  00m01s
 Fedora 38 - aarch64 - Test Updates     100% |   3.4 KiB/s |   4.2 KiB |  00m01s
 Fedora 38 - aarch64 - Test Updates     100% | 531.7 KiB/s |   1.6 MiB |  00m03s
 RPM Fusion for Fedora 38 - Free - Test 100% |   1.6 KiB/s |   2.6 KiB |  00m02s
 RPM Fusion for Fedora 38 - Free - Test 100% |  17.2 KiB/s |  36.3 KiB |  00m02s
 RPM Fusion for Fedora 38 - Nonfree     100% |  10.2 KiB/s |  14.8 KiB |  00m01s
 RPM Fusion for Fedora 38 - Nonfree     100% |  35.7 KiB/s |  68.7 KiB |  00m02s
 Copr repo for kernel owned by @asahi   100% |   2.9 KiB/s |   3.3 KiB |  00m01s
 Copr repo for kernel owned by @asahi   100% | 631.2 KiB/s | 914.0 KiB |  00m01s
 RPM Fusion for Fedora 38 - Nonfree - T 100% |   9.3 KiB/s |  13.9 KiB |  00m01s
 RPM Fusion for Fedora 38 - Nonfree - T 100% |  16.8 KiB/s |  29.9 KiB |  00m02s
 RPM Fusion for Fedora 38 - Free        100% |   2.2 KiB/s |   2.7 KiB |  00m01s
 RPM Fusion for Fedora 38 - Free        100% |  60.0 KiB/s | 175.8 KiB |  00m03s
 Copr repo for fedora-remix-branding ow 100% |   3.5 KiB/s |   3.3 KiB |  00m01s
 Copr repo for fedora-remix-branding ow 100% |  19.9 KiB/s |  16.1 KiB |  00m01s
 Fedora 38 - aarch64                    100% |   4.7 KiB/s |   3.7 KiB |  00m01s
 Fedora 38 - aarch64                    100% |   2.0 MiB/s |   6.9 MiB |  00m04s
 Visual Studio Code                     100% |   6.9 KiB/s |   1.5 KiB |  00m00s
 Visual Studio Code                     100% | 756.6 KiB/s | 576.5 KiB |  00m01s
 Fedora 38 - aarch64 - Updates          100% |   2.8 KiB/s |   4.4 KiB |  00m02s
Repositories loaded.

@teohhanhui
Copy link
Author

diff --git a/speedtest.py b/speedtest.py
index 05e67bc..25e31ea 100644
--- a/speedtest.py
+++ b/speedtest.py
@@ -67,8 +67,8 @@ def speed_test(links, ostm, archi):
                         f.write(chunk)
                         done = int(30 * dl / int(total_length))
                         sys.stdout.write(
-                            f"\r{link} [%s%s] %s Kbps" % (
-                                '=' * done, ' ' * (30 - done), dl // (time.perf_counter() - start) / 1000))
+                            f"\r{link} [%s%s] %s KiB/s" % (
+                                '=' * done, ' ' * (30 - done), round(dl / (time.perf_counter() - start) / 1024, 2)))
 
             speed = dl // (time.perf_counter() - start) / 100000
             print('\n')

With this change I get:

Checking Japan mirrors: ['http://ftp.riken.jp/Linux/fedora', 'https://ftp.riken.jp/Linux/fedora', 'https://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/fedora/linux', 'http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/fedora/linux']

http://ftp.riken.jp/Linux/fedora [==============================] 1.35 KiB/s

https://ftp.riken.jp/Linux/fedora [==============================] 0.66 KiB/s

https://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/fedora/linux [==============================] 0.28 KiB/s

http://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/fedora/linux [==============================] 1.08 KiB/s

which looks clearer.

(Of course this is unrelated to the problem of the speedtest not actually measuring anything useful...)

@fardinkamal62
Copy link
Owner

Correct me, you've converted Kbps to KiB/s
That's what you're trying to say?

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

No branches or pull requests

2 participants