jsdelivr / globalping

A global network of probes to run network tests like ping, traceroute and DNS resolve

Home Page:https://www.jsdelivr.com/globalping

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow reusing measurement IDs for selecting same group of probes

jimaek opened this issue · comments

Fixes #363

This feature will allow non-stop tests for ping and mtr (supported by client logic) and also allow anyone to compare 2 endpoints using the exact same probes without knowing their IDs.

The measurement ID to probe mapping must be instant to allow the user to start a new measurement with the same probes while the first one is still running,

In terms of the API, I'm thinking of overloading the locations array so that if you pass in a string, it's interpreted as a measurement ID, and the locations are reused from that ID.

Additionally, if locations.length === 1 and it's magic, and it doesn't match anything, as the last step, we should try to interpret it as a measurement ID as well. This will allow users to paste the ID into any of our tools that support the magic mode.

measurement with id1 had 20 probes, user starts a new measurement with locations: id1 but API found only 19 of prev probes (1 is disconnected right now). Should api proceed and return OK {probesCount: 19} or try replace missing or send 422?

OK and 19 but the client must know which probe that is (order of results must match) since the goal is comparing the two runs.

I'm thinking the best way might be keeping the probe in the results array and filling the result with a new probe-level error. Similar to probe timeout but with a different type probably - unavailable or offline ?

offline status makes sense. Then, since it is treated as a probe with error, probesCount should be 20 I think.