-
Notifications
You must be signed in to change notification settings - Fork 116
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
Library example always shows ZERO as Download speed(user agent is overwritten with empty string) #159
Comments
Mbps
Could you enable debug to get more information. speedtest.WithUserConfig(&speedtest.UserConfig{Source: viaIP, Debug: true})(speedtestClient) |
My print statement looks like this and always gives 0.000 as result:
I enabled Debug as you suggested and got this output:
|
curl http://speedtest1.cwpanama.net:8080/speedtest/random1000x1000.jpg Can you get a response with this command?
I used the same code as you.
According to this comment, it also be zero when you use speedtest-go binary. |
With me the speedtest-go binary reports non-zero Upload & Download speeds, unlike the example which zeroes-out the Download speed. At least in my system. Tried the Curl with --output curl.txt and the terminal shows this:
|
So, is this going to be fixed? the Download speed is by far the most important measurement and yet the library version always shows zero download. |
Yes, we will fix it this week, it is caused by empty user-agent. You can temporarily fix this issue by adding a UA. var speedtestClient = speedtest.New()
speedtest.WithUserConfig(&speedtest.UserConfig{UserAgent: "user"})(speedtestClient)
if server, err := speedtestClient.FetchServerByID("13384"); err == nil {
server.DownloadTest()
} |
sorry, we may need |
I added the user agent stuff to my initialization, so the rest of my code is unchanged. Now when I run the speedtest from my program (as I said, nothing else has changed) I get the Speedtest library return this error:
The debug output I get is this:
I then updated to the latest speedtest version (1.6.9, I had 1.6.7) but the output with user agent remains EOF. However, the pre-compiled binary (speedtest-go) works as usual. |
However... when I changed the User Agent value from "user" to that of a Samsung Galaxy A53, it stopped producing the EOF error. So, I am using this:
|
I dont know. This may be related to the test server UA policy(eg: The user agent is limited to a minimum length must > n?) And an empty UA will always trigger an EOF error. |
With version>=1.6.8, You can set UA selectively, because we have temporarily fixed this problem, default UA will not be overwritten with empty string. remove UA setting is ok. var speedtestClient = speedtest.New()
speedtest.WithUserConfig(&speedtest.UserConfig{})(speedtestClient)
if server, err := speedtestClient.FetchServerByID("13384"); err == nil {
server.DownloadTest()
} |
On my Raspberry Pi 2B I downloaded this library and executable. The executable runs and displays values for both Upload and Download. However, when I try the supplied example on my GO program, despite requesting both Upload and Download, when my program finishes executing GOSPEED via the library, I shows this (I used server 13884):
Latency: 312.56ms, Download: 0.00000, Upload: 1.835000
And the code taken from your example is:
So, what am I missing? why the downloaded executable shows a download speed but the library example reports it always as zero? And BTW, what are the units of those speeds?
The text was updated successfully, but these errors were encountered: