소스 검색

Improved ping/jitter test

dosse91 9 년 전
부모
커밋
23b188b3ce
4개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 2
      doc.md
  2. 1 0
      empty.php
  3. 2 2
      speedtest_worker.js
  4. 0 0
      speedtest_worker.min.js

+ 3 - 2
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

+ 1 - 0
empty.php

@@ -3,4 +3,5 @@ header( "HTTP/1.1 200 OK" );
 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");
 ?>

+ 2 - 2
speedtest_worker.js

@@ -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

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
speedtest_worker.min.js


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.