sindresorhus / speed-test

Test your internet connection speed and ping using speedtest.net from the CLI
MIT License
3.91k stars 164 forks source link

Location, location... #33

Closed mateatslc closed 8 years ago

mateatslc commented 8 years ago

wherever I run it, tests against speedo.eltele.no in Alta, Norway resulting in incorrect measurements.

screen shot 2016-02-11 at 10 42 50 am

OSX 10.11.3 / iTerm2 / testing from Hungary

SamVerschueren commented 8 years ago

@mateatslc Would you be able to log what server.distance holds? https://github.com/sindresorhus/speed-test/blob/master/cli.js#L78

Seems like the speed-test API we use might not return a numeric value in your case.

sindresorhus commented 8 years ago

// @ddsol

mateatslc commented 8 years ago

server.distance is null here is the complete server object stringified:

{
  "bestPing": 165.76601300000002,
  "cc": "NO",
  "country": "Norway",
  "dist": null,
  "distMi": null,
  "id": "3433",
  "lat": "69.9403",
  "lon": "23.3106",
  "name": "Alta",
  "sponsor": "Eltele AS",
  "url": "http://speedo.eltele.no/speedtest/upload.php"
}
paicha commented 8 years ago

Same issue, testing from China.

SamVerschueren commented 8 years ago

@sindresorhus What should be shown if distance is null? Grayed out Unknown?

ddsol commented 8 years ago

I'm not understanding how dist could ever be null. Is this data coming from before that line? Maybe some more console.log lines could help here, together with where these lines are.

clarkio commented 8 years ago

@mateatslc I think this is related to the issue I was seeing when running this module. I was finding it always defaulting to the Norway server you mentioned as well. Digging deeper I found it to be an issue where the dependency module, speedtest.net, had a request being blocked by the speedtest.net service. See more details here: https://github.com/ddsol/speedtest.net/issues/19

This should be fixed now. Reinstall speed-test, making sure it pulls in speedtest-net@1.2.5 and you should see the expected results.

mateatslc commented 8 years ago

@clarkio thanks! works indeed, with speedtest-net@1.2.5 @sindresorhus created #34

SamVerschueren commented 8 years ago

No need to bump the version. Because of semver, speedtest-net@1.2.5 will be installed automatically when reinstalling speed-test.

mateatslc commented 8 years ago

Better safe than sorry ;)

clarkio commented 8 years ago

Yes, no need to bump the version. I was referring to the install log when installing speed-test to see that it shows speedtest-net@1.2.5.