this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add functions to log final speeds

+20 -12
+20 -12
cli.js
··· 222 222 ); 223 223 } 224 224 225 + function logDownloadSpeed(tests) { 226 + console.log( 227 + bold( 228 + ' Download speed:', 229 + green(stats.quartile(tests, 0.9).toFixed(2), 'Mbps') 230 + ) 231 + ); 232 + } 233 + 234 + function logUploadSpeed(tests) { 235 + console.log( 236 + bold( 237 + ' Upload speed:', 238 + green(stats.quartile(tests, 0.9).toFixed(2), 'Mbps') 239 + ) 240 + ); 241 + } 242 + 225 243 async function speedTest() { 226 244 const serverLocationData = await fetchServerLocationData(); 227 245 const { ip, loc, colo } = await fetchCfCdnCgiTrace(); ··· 254 272 ...testDown4, 255 273 ...testDown5, 256 274 ]; 257 - console.log( 258 - bold( 259 - ' Download speed:', 260 - green(stats.quartile(downloadTests, 0.9).toFixed(2), 'Mbps') 261 - ) 262 - ); 275 + logDownloadSpeed(downloadTests); 263 276 264 277 const testUp1 = await measureUpload(11000, 10); 265 278 const testUp2 = await measureUpload(101000, 10); 266 279 const testUp3 = await measureUpload(1001000, 8); 267 280 const uploadTests = [...testUp1, ...testUp2, ...testUp3]; 268 - console.log( 269 - bold( 270 - ' Upload speed:', 271 - green(stats.quartile(uploadTests, 0.9).toFixed(2), 'Mbps') 272 - ) 273 - ); 281 + logUploadSpeed(uploadTests); 274 282 } 275 283 276 284 speedTest();