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

Client should iterate over Locate API results #9

Open
stephen-soltesz opened this issue Oct 12, 2020 · 1 comment
Open

Client should iterate over Locate API results #9

stephen-soltesz opened this issue Oct 12, 2020 · 1 comment
Assignees

Comments

@stephen-soltesz
Copy link
Contributor

As currently written, the ndt7-js client uses a random result returned by the Locate API and does not save the unused results. This is a mistake. Because any ndt-server may decline to run a measurement, the client should iterate through available results from the Locate API until a working server is found or all results are exhausted.

@nkinkade
Copy link

Another unintended consequence of selecting a random site from the results returned from the locate service is that singleton sites will have a high probability of testing to a server that is neither close, nor necessarily even in the same country. A good example of this is at NBO01 in Kenya. Currently, if you query the locate service like this:

http://locate.measurementlab.net/v2/nearest/ndt/ndt7?country=KE

... you get something like:

{
  "results": [
    {
      "machine": "mlab3-nbo01.mlab-oti.measurement-lab.org",
      <snip>
    },
    {
      "machine": "mlab1-tnr01.mlab-oti.measurement-lab.org",
      <snip>
    },
    {
      "machine": "mlab2-jnb01.mlab-oti.measurement-lab.org",
      <snip>
    },
    {
      "machine": "mlab2-los02.mlab-oti.measurement-lab.org",
      <snip>
    }
  ]
}

This means that there is a 75% chance that client will test to a location quite far away and in a different country.

A quick remedy for this would be to stop selecting targets at random and to iterate through them from first to last. Notwithstanding other issues, this would give a client a good probability of running a successful test to the closest server.

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

4 participants