From fd620f7d6b63f3cd115bb7ccc0f7980405a708d2 Mon Sep 17 00:00:00 2001 From: roks0n Date: Mon, 6 May 2019 08:46:19 +0200 Subject: [PATCH] modify stat report --- app.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app.js b/app.js index 75e350b..6aff90f 100644 --- a/app.js +++ b/app.js @@ -37,14 +37,15 @@ const report = (crawler) => { const minDelay = Math.min(...allDelays) console.log(`===========================================`) - console.log(`Total nodes visited: ${Object.keys(crawler.nodes).length}`) - console.log(`Total nodes online: ${crawler.heights.length}`) - console.log(`------------------------------------------`) + console.log(`All nodes: ${Object.keys(crawler.nodes).length}`) + console.log(`Nodes online: ${crawler.heights.length}`) + console.log(`Nodes offline: ${Object.keys(crawler.nodes).length - crawler.heights.length}`) // height/block stats + console.log(``) console.log(`Height and block stats:`) for (const stat of orderBy(Object.values(blockStats), ['height'], ['desc'])) { - console.log(` ${stat.count} nodes on height ${stat.height} with hashes:`) + console.log(` ${stat.height} with ${stat.count} nodes. Block hashes:`) for (const hash in stat.ids) { console.log(` - ${hash} (${stat.ids[hash]} nodes)`) } @@ -54,15 +55,15 @@ const report = (crawler) => { console.log(``) console.log(`Version stats:`) for (const stat of orderBy(Object.values(versionStats), ['version'], ['desc'])) { - console.log(` - ${stat.count} nodes on version ${stat.version}`) + console.log(` - ${stat.version} on ${stat.count} nodes`) } // delay stats console.log(``) console.log(`Delay`) - console.log(` Average delay: ${averageDelay}`) - console.log(` Min delay: ${minDelay}`) - console.log(` Max delay: ${maxDelay}`) + console.log(` Average: ${averageDelay}ms`) + console.log(` Min: ${minDelay}ms`) + console.log(` Max: ${maxDelay}ms`) console.log(`------------------------------------------`) console.log(`Finished scanning in ${new Date() - crawler.startTime}ms`)