Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
e5c37b1801 | |||
5be0586790 | |||
f5e5297d47 | |||
718fada493 | |||
a42b1b48b5 | |||
5ec50975f3 |
1207
package-lock.json
generated
1207
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnetwork",
|
"name": "@pushrocks/smartnetwork",
|
||||||
"version": "2.0.7",
|
"version": "2.0.10",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "network diagnostics",
|
"description": "network diagnostics",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -24,7 +24,6 @@
|
|||||||
"@types/default-gateway": "^3.0.1",
|
"@types/default-gateway": "^3.0.1",
|
||||||
"isopen": "^1.3.0",
|
"isopen": "^1.3.0",
|
||||||
"public-ip": "^4.0.3",
|
"public-ip": "^4.0.3",
|
||||||
"speedtest-net": "^2.1.1",
|
|
||||||
"systeminformation": "^5.6.12"
|
"systeminformation": "^5.6.12"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -10,24 +10,21 @@ export class CloudflareSpeed {
|
|||||||
const serverLocations = await this.fetchServerLocations();
|
const serverLocations = await this.fetchServerLocations();
|
||||||
const cgiData = await this.fetchCfCdnCgiTrace();
|
const cgiData = await this.fetchCfCdnCgiTrace();
|
||||||
|
|
||||||
|
// lets test the download speed
|
||||||
const testDown1 = await this.measureDownload(101000, 10);
|
const testDown1 = await this.measureDownload(101000, 10);
|
||||||
|
|
||||||
const testDown2 = await this.measureDownload(1001000, 8);
|
const testDown2 = await this.measureDownload(1001000, 8);
|
||||||
|
|
||||||
const testDown3 = await this.measureDownload(10001000, 6);
|
const testDown3 = await this.measureDownload(10001000, 6);
|
||||||
|
|
||||||
const testDown4 = await this.measureDownload(25001000, 4);
|
const testDown4 = await this.measureDownload(25001000, 4);
|
||||||
|
|
||||||
const testDown5 = await this.measureDownload(100001000, 1);
|
const testDown5 = await this.measureDownload(100001000, 1);
|
||||||
|
|
||||||
const downloadTests = [...testDown1, ...testDown2, ...testDown3, ...testDown4, ...testDown5];
|
const downloadTests = [...testDown1, ...testDown2, ...testDown3, ...testDown4, ...testDown5];
|
||||||
const speedDownload = stats.median(downloadTests).toFixed(2);
|
const speedDownload = stats.quartile(downloadTests, 0.9).toFixed(2);
|
||||||
|
|
||||||
|
// lets test the upload speed
|
||||||
const testUp1 = await this.measureUpload(11000, 10);
|
const testUp1 = await this.measureUpload(11000, 10);
|
||||||
const testUp2 = await this.measureUpload(101000, 10);
|
const testUp2 = await this.measureUpload(101000, 10);
|
||||||
const testUp3 = await this.measureUpload(1001000, 8);
|
const testUp3 = await this.measureUpload(1001000, 8);
|
||||||
const uploadTests = [...testUp1, ...testUp2, ...testUp3];
|
const uploadTests = [...testUp1, ...testUp2, ...testUp3];
|
||||||
const speedUpload = stats.median(uploadTests).toFixed(2);
|
const speedUpload = stats.quartile(uploadTests, 0.9).toFixed(2);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...latency,
|
...latency,
|
||||||
|
Reference in New Issue
Block a user