|
|
|
|
|
by a1445c8b
1363 days ago
|
|
Great start! One way you could improve this is to not stop at just reporting a single data point but report the P50, P75, and P90 of a reasonable set of data points. Also, it's probably better to call this HTTP latency rather than ping since the latter is on a much lower layer in the OSI model. |
|
Labelling this a "ping" was a poor choice on my part. I meant ping in the RTT/latency sense, rather than an ICMP sense. Calling it "HTTP latency" is a huge improvement that clearly (and concisely) gets the idea across, I made a quick edit to do just that.
RE: recording a range of samples and reporting percentiles: My hope is to keep the code super simple and the delay to visible info in the UI very low. Elsewhere in the thread folks mentioned the excellent http://gcping.com/. That site has a ton of destinations to test latency to and reports the median of a number of samples - that is a really cool feature set! I don't think I'll be able to do anything close to that in tens of lines of inline JS, unfortunately.
Still, the measurements start super noisy and I'd like to ensure my site gives useful data even at the start. I did a bit of a hack to hopefully force the RTT to converge to something useful. I now fire off 3 time-delayed measurements after the page loads. By the time the third finishes, the numbers appear to be pretty stable.