From 699e842c8bfdfd58658af624e9ac3a8e86e96588 Mon Sep 17 00:00:00 2001 From: roks0n Date: Sun, 30 Jun 2019 13:02:49 +0200 Subject: [PATCH] round averageDelay --- app.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 490903c..769fb25 100644 --- a/app.js +++ b/app.js @@ -35,7 +35,7 @@ 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 + const averageDelay = (allDelays.reduce((a, b) => a + b, 0) / allDelays.length).toFixed(2) const maxDelay = Math.max(...allDelays) const minDelay = Math.min(...allDelays) @@ -64,7 +64,7 @@ const report = (crawler) => { // delay stats console.log(``) console.log(`Delay`) - console.log(` Average: ${averageDelay}ms`) + console.log(` Avg: ${averageDelay}ms`) console.log(` Min: ${minDelay}ms`) console.log(` Max: ${maxDelay}ms`) diff --git a/package.json b/package.json index 1fec5d8..d33be41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deadlock-delegate/crawler", - "version": "1.2.0", + "version": "1.2.1", "description": "Crawler scans the ARK network to get information about the peers in the network.", "main": "app.js", "scripts": {