From 71137f3e9a7b1f21abe3ab604ebf0fb0182d46bc Mon Sep 17 00:00:00 2001 From: 2DT Date: Tue, 9 Feb 2021 16:48:15 +0100 Subject: [PATCH 1/2] Version is retrieved from the config attribute --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index d41ab1b..ebbd5d1 100644 --- a/app.js +++ b/app.js @@ -43,7 +43,7 @@ const report = (crawler) => { nodeStats[node.ip] = { ip: node.ip, location: node.location, - version: node.version, + version: node.config.version, height: node.height } } From 89dd6ab02d16d39f68aaf4a5d174e561d2a812e8 Mon Sep 17 00:00:00 2001 From: 2DT Date: Tue, 9 Feb 2021 16:50:12 +0100 Subject: [PATCH 2/2] Removed delay stats, which is not inside the info json anymore --- app.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/app.js b/app.js index ebbd5d1..b0c2b23 100644 --- a/app.js +++ b/app.js @@ -49,11 +49,6 @@ const report = (crawler) => { } } - const allDelays = nodes.filter(item => item.latency).map(item => item.latency) - const averageDelay = (allDelays.reduce((a, b) => a + b, 0) / allDelays.length).toFixed(2) - const maxDelay = Math.max(...allDelays) - const minDelay = Math.min(...allDelays) - // Node stats; console.log('Individual node stats'); for (const node of orderBy(Object.values(nodeStats),['ip'],['desc'])) { @@ -88,14 +83,7 @@ const report = (crawler) => { for (const stat of orderBy(Object.values(versionStats), ['version'], ['desc'])) { console.log(` - ${stat.version} on ${stat.count} nodes`) } - - // delay stats - console.log('') - console.log('Delay') - console.log(` Avg: ${averageDelay}ms`) - console.log(` Min: ${minDelay}ms`) - console.log(` Max: ${maxDelay}ms`) - + console.log('------------------------------------------') console.log(`Finished scanning in ${new Date() - crawler.startTime}ms`)