Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate packet-test #72

Merged
merged 6 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<script type="text/javascript" src="libraries/ua-device-detector.min.js"></script>
<script type="text/javascript" src="libraries/ng-device-detector.min.js"></script>
<script type="text/javascript" src="libraries/msak.min.js"></script>
<script type="text/javascript" src="libraries/pt.min.js"></script>

<script src="measure/measure.js"></script>
<script src="services/gaugeService.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions app/measure/measure.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ <h1 translate>Test Your Speed</h1>
</div>
</div>
</p>
<small style="font-style: italic;">We are temporarily running two tests back to back to calibrate a new
measurement protocol. This means
<small style="font-style: italic;">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.
</small><br /><br />
<small translate>For more on M-Lab's data collection and measurement, including the disclosure of IP addresses,
Expand Down
31 changes: 31 additions & 0 deletions app/measure/measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ angular.module('Measure.Measure', ['ngRoute'])
await runNdt7(sessionID);
}

await runPT(sessionID)

$scope.$apply(function () {
$scope.currentPhase = gettextCatalog.getString('Complete');
$scope.currentSpeed = '';
Expand Down Expand Up @@ -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 to:', {
machine: server.machine,
locations: server.location,
});
},
downloadComplete: (data) => {
console.log("PT result:", data);
},
},
)
}

});

/**
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
bufferutil "^4.0.6"
utf-8-validate "^5.0.8"

"@m-lab/[email protected]":
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"

[email protected]:
version "1.3.3"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca"
Expand Down Expand Up @@ -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==

[email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa"
Expand Down