Permalink
Browse files

Improved ping/jitter test

  • Loading branch information...
adolfintel committed Jun 14, 2017
1 parent 710887f commit 23b188b3cefdfc8bfd949de952dde165022ee905
Showing with 7 additions and 5 deletions.
  1. +3 −2 doc.md
  2. +1 −0 empty.php
  3. +2 −2 speedtest_worker.js
  4. +1 −1 speedtest_worker.min.js
5 doc.md
@@ -1,7 +1,7 @@
# HTML5 Speedtest

> by Federico Dossena
> Version 4.2.2, June 13 2017
> Version 4.2.3, June 14 2017
> [https://github.com/adolfintel/speedtest/](https://github.com/adolfintel/speedtest/)

@@ -206,7 +206,7 @@ It is important here to turn off compression, and generate incompressible data.
A symlink to `/dev/urandom` is also ok.

#### Replacement for `empty.php`
Your replacement must simply respond with a HTTP code 200 and send nothing else. You may want to send additional headers to disable caching.
Your replacement must simply respond with a HTTP code 200 and send nothing else. You may want to send additional headers to disable caching. The test assumes that Connection:keep-alive is sent by the server.

#### Replacement for `getIP.php`
Your replacement must simply respond with the client's IP as plaintext. Nothing fancy.
@@ -220,6 +220,7 @@ w.postMessage('start {"url_dl": "newGarbageURL", "url_ul": "newEmptyURL", "url_p


## Known bugs and limitations
* The ping/jitter test is measured by seeing how long it takes for an empty XHR to complete. It is not an acutal ICMP ping
* __Chrome:__ high CPU usage from XHR requests with very fast connections (like gigabit).
For this reason, the test may report inaccurate results if your CPU is too slow. (Does not affect most computers)
* __IE11:__ the upload test is not precise on very fast connections
@@ -3,4 +3,5 @@
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Connection: keep-alive");
?>
@@ -1,5 +1,5 @@
/*
HTML5 Speedtest v4.2.2
HTML5 Speedtest v4.2.3
by Federico Dossena
https://github.com/adolfintel/speedtest/
GNU LGPLv3 License
@@ -325,7 +325,7 @@ function pingTest (done) {
if (i === 0) {
prevT = new Date().getTime() // first pong
} else {
var instspd = (new Date().getTime() - prevT) / 2
var instspd = (new Date().getTime() - prevT)
var instjitter = Math.abs(instspd - prevInstspd)
if (i === 1) ping = instspd; /* first ping, can't tell jiutter yet*/ else {
ping = ping * 0.9 + instspd * 0.1 // ping, weighted average

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 23b188b

Please sign in to comment.