Skip to content

Commit

Permalink
round averageDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
roks0n committed Jun 30, 2019
1 parent c60ace3 commit 699e842
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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`)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 699e842

Please sign in to comment.