Skip to content

Commit

Permalink
Merge pull request #3 from tw0517tw/patch-2
Browse files Browse the repository at this point in the history
Catch pidusage errors
  • Loading branch information
capaj authored Oct 19, 2016
2 parents c4c6618 + 1df52c2 commit 613d42a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const gatherOsMetrics = (io, span) => {
}

pidusage.stat(process.pid, (err, stat) => {
if (err) {
console.error(err)
return
}
stat.memory = stat.memory / 1024 / 1024 // Convert from B to MB
stat.load = os.loadavg()
stat.timestamp = Date.now()
Expand Down

0 comments on commit 613d42a

Please sign in to comment.