diff --git a/app/index.html b/app/index.html index d974106..d844608 100644 --- a/app/index.html +++ b/app/index.html @@ -60,6 +60,7 @@ + diff --git a/app/measure/measure.html b/app/measure/measure.html index b13877a..f184678 100755 --- a/app/measure/measure.html +++ b/app/measure/measure.html @@ -32,8 +32,8 @@

Test Your Speed

- We are temporarily running two tests back to back to calibrate a new - measurement protocol. This means + We are temporarily running multiple tests back to back to calibrate new + measurement protocols. This means results may take a little longer to appear than usual. Thank you for your help.

For more on M-Lab's data collection and measurement, including the disclosure of IP addresses, diff --git a/app/measure/measure.js b/app/measure/measure.js index 8c28b68..9bc5b1e 100755 --- a/app/measure/measure.js +++ b/app/measure/measure.js @@ -56,6 +56,8 @@ angular.module('Measure.Measure', ['ngRoute']) await runNdt7(sessionID); } + runPT(sessionID) + $scope.$apply(function () { $scope.currentPhase = gettextCatalog.getString('Complete'); $scope.currentSpeed = ''; @@ -182,6 +184,35 @@ angular.module('Measure.Measure', ['ngRoute']) await client.start(); } + + async function runPT(sid) { + return pt.test( + { + userAcceptedDataPolicy: true, + downloadworkerfile: "/libraries/pt-download-worker.min.js", + metadata: { + client_name: "speed-measurementlab-net", + client_session_id: sid, + max_cwnd_gain: "512", + } + }, + { + serverChosen: function (server) { + $scope.location = server.location.city + ", " + + server.location.country; + $scope.address = server.machine; + console.log('Testing PT to:', { + machine: server.machine, + locations: server.location, + }); + }, + downloadComplete: (data) => { + console.log("PT result:", data); + }, + }, + ) + } + }); /** diff --git a/gulpfile.js b/gulpfile.js index 99bdee2..bea1058 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -43,6 +43,7 @@ function copy_libs(cb) { gulp.src([ "./node_modules/@m-lab/ndt7/src/*.min.js", "./node_modules/@m-lab/msak/dist/*.min.js", + "./node_modules/@m-lab/packet-test/src/*.min.js", ]) .pipe(gulp.dest('./app/libraries')); diff --git a/package.json b/package.json index 0df1518..7e212ca 100755 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@bower_components/skel": "n33/skel#~3.0.1", "@m-lab/msak": "0.3.1", "@m-lab/ndt7": "0.0.6", + "@m-lab/packet-test": "0.0.16", "ng-device-detector": "^5.1.4", "re-tree": "^0.1.7", "ua-device-detector": "^1.1.8" diff --git a/yarn.lock b/yarn.lock index c2a06b0..3f6d6e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -58,6 +58,13 @@ bufferutil "^4.0.6" utf-8-validate "^5.0.8" +"@m-lab/packet-test@0.0.16": + version "0.0.16" + resolved "https://registry.yarnpkg.com/@m-lab/packet-test/-/packet-test-0.0.16.tgz#9d45de5f4003ca369225d88ad7a429e85aa87c5a" + integrity sha512-aUx/Q6fR26YJgchnPGXAWvuZT8OT3b22SgIenllT9v5NZbL2HcDGJ77xzSqZ3jzMEA6rG9tHMXfjQGbf1iQfhQ== + dependencies: + uglify-js "^3.19.2" + accepts@1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca" @@ -4193,6 +4200,11 @@ ua-parser-js@^1.0.37: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.37.tgz#b5dc7b163a5c1f0c510b08446aed4da92c46373f" integrity sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ== +uglify-js@^3.19.2: + version "3.19.2" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.19.2.tgz#319ae26a5fbd18d03c7dc02496cfa1d6f1cd4307" + integrity sha512-S8KA6DDI47nQXJSi2ctQ629YzwOVs+bQML6DAtvy0wgNdpi+0ySpQK0g2pxBq2xfF2z3YCscu7NNA8nXT9PlIQ== + ultron@1.0.x: version "1.0.2" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa"