From 520a2757d572ce48bb50c239666a59a83d294cf7 Mon Sep 17 00:00:00 2001 From: adolfintel Date: Wed, 10 Apr 2019 07:22:41 +0200 Subject: [PATCH] Updated quirks --- doc.md | 6 +++--- garbage.php | 2 +- speedtest_worker.js | 4 ++-- speedtest_worker.min.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc.md b/doc.md index cc6a810..001b7d7 100644 --- a/doc.md +++ b/doc.md @@ -223,11 +223,11 @@ w.postMessage('start '+JSON.stringify(params)) * __enable_quirks__: enables browser-specific optimizations. These optimizations override some of the default settings. They do not override settings that are explicitly set. * Default: `true` * __garbagePhp_chunkSize__: size of chunks sent by garbage.php in megabytes - * Default: `20` + * Default: `100` * Recommended: `>=10` - * Maximum: `100` + * Maximum: `1024` * __xhr_dlMultistream__: how many streams should be opened for the download test - * Default: `10` + * Default: `6` * Recommended: `>=3` * Default override: 3 on Edge if enable_quirks is true * Default override: 5 on Chromium-based if enable_quirks is true diff --git a/garbage.php b/garbage.php index 27c1bfc..351c496 100644 --- a/garbage.php +++ b/garbage.php @@ -19,7 +19,7 @@ $data=openssl_random_pseudo_bytes(1048576); // Deliver chunks of 1048576 bytes $chunks=isset($_GET['ckSize']) ? intval($_GET['ckSize']) : 4; if(empty($chunks)){$chunks = 4;} -if($chunks>100){$chunks = 100;} +if($chunks>1024){$chunks = 1024;} for($i=0;$i<$chunks;$i++){ echo $data; flush(); diff --git a/speedtest_worker.js b/speedtest_worker.js index 6fec4ae..b440e6c 100644 --- a/speedtest_worker.js +++ b/speedtest_worker.js @@ -50,13 +50,13 @@ var settings = { url_getIp: "getIP.php", // path to getIP.php relative to this js file, or a similar thing that outputs the client's ip getIp_ispInfo: true, //if set to true, the server will include ISP info with the IP address getIp_ispInfo_distance: "km", //km or mi=estimate distance from server in km/mi; set to false to disable distance estimation. getIp_ispInfo must be enabled in order for this to work - xhr_dlMultistream: 10, // number of download streams to use (can be different if enable_quirks is active) + xhr_dlMultistream: 6, // number of download streams to use (can be different if enable_quirks is active) xhr_ulMultistream: 3, // number of upload streams to use (can be different if enable_quirks is active) xhr_multistreamDelay: 300, //how much concurrent requests should be delayed xhr_ignoreErrors: 1, // 0=fail on errors, 1=attempt to restart a stream if it fails, 2=ignore all errors xhr_dlUseBlob: false, // if set to true, it reduces ram usage but uses the hard drive (useful with large garbagePhp_chunkSize and/or high xhr_dlMultistream) xhr_ul_blob_megabytes: 20, //size in megabytes of the upload blobs sent in the upload test (forced to 4 on chrome mobile) - garbagePhp_chunkSize: 20, // size of chunks sent by garbage.php (can be different if enable_quirks is active) + garbagePhp_chunkSize: 100, // size of chunks sent by garbage.php (can be different if enable_quirks is active) enable_quirks: true, // enable quirks for specific browsers. currently it overrides settings to optimize for specific browsers, unless they are already being overridden with the start command ping_allowPerformanceApi: true, // if enabled, the ping test will attempt to calculate the ping more precisely using the Performance API. Currently works perfectly in Chrome, badly in Edge, and not at all in Firefox. If Performance API is not supported or the result is obviously wrong, a fallback is provided. overheadCompensationFactor: 1.06, //can be changed to compensatie for transport overhead. (see doc.md for some other values) diff --git a/speedtest_worker.min.js b/speedtest_worker.min.js index 444657b..7f26384 100644 --- a/speedtest_worker.min.js +++ b/speedtest_worker.min.js @@ -1 +1 @@ -var testStatus=-1,dlStatus="",ulStatus="",pingStatus="",jitterStatus="",clientIp="",dlProgress=0,ulProgress=0,pingProgress=0,testId=null,log="";function tlog(s){2<=settings.telemetry_level&&(log+=Date.now()+": "+s+"\n")}function tverb(s){3<=settings.telemetry_level&&(log+=Date.now()+": "+s+"\n")}function twarn(s){2<=settings.telemetry_level&&(log+=Date.now()+" WARN: "+s+"\n"),console.warn(s)}var settings={test_order:"IP_D_U",time_ul_max:15,time_dl_max:15,time_auto:!0,time_ulGraceTime:3,time_dlGraceTime:1.5,count_ping:10,url_dl:"garbage.php",url_ul:"empty.php",url_ping:"empty.php",url_getIp:"getIP.php",getIp_ispInfo:!0,getIp_ispInfo_distance:"km",xhr_dlMultistream:10,xhr_ulMultistream:3,xhr_multistreamDelay:300,xhr_ignoreErrors:1,xhr_dlUseBlob:!1,xhr_ul_blob_megabytes:20,garbagePhp_chunkSize:20,enable_quirks:!0,ping_allowPerformanceApi:!0,overheadCompensationFactor:1.06,useMebibits:!1,telemetry_level:0,url_telemetry:"telemetry/telemetry.php",telemetry_extra:""},xhr=null,interval=null,test_pointer=0;function url_sep(url){return url.match(/\?/)?"&":"?"}function clearRequests(){if(tverb("stopping pending XHRs"),xhr){for(var i=0;i=settings.test_order.length)0settings.time_dl_max||failed)&&((failed||isNaN(dlStatus))&&(dlStatus="Fail"),clearRequests(),clearInterval(interval),dlProgress=1,tlog("dlTest: "+dlStatus+", took "+((new Date).getTime()-startT)+"ms"),done())}else t>1e3*settings.time_dlGraceTime&&(0settings.time_ul_max||failed)&&((failed||isNaN(ulStatus))&&(ulStatus="Fail"),clearRequests(),clearInterval(interval),ulProgress=1,tlog("ulTest: "+ulStatus+", took "+((new Date).getTime()-startT)+"ms"),done())}else t>1e3*settings.time_ulGraceTime&&(0=settings.test_order.length)0settings.time_dl_max||failed)&&((failed||isNaN(dlStatus))&&(dlStatus="Fail"),clearRequests(),clearInterval(interval),dlProgress=1,tlog("dlTest: "+dlStatus+", took "+((new Date).getTime()-startT)+"ms"),done())}else t>1e3*settings.time_dlGraceTime&&(0settings.time_ul_max||failed)&&((failed||isNaN(ulStatus))&&(ulStatus="Fail"),clearRequests(),clearInterval(interval),ulProgress=1,tlog("ulTest: "+ulStatus+", took "+((new Date).getTime()-startT)+"ms"),done())}else t>1e3*settings.time_ulGraceTime&&(0