Skip to content

Commit

Permalink
Merge pull request #4 from bacali95/fix-mem
Browse files Browse the repository at this point in the history
Fix free memory calculation equation.
  • Loading branch information
SunilWang authored Oct 25, 2019
2 parents 64d8e1e + 80e8b79 commit 4f56e89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mem.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bucket.mem = {
var resultMemory = (out.match(/\d+/g))

totalMem = parseInt(resultMemory[0], 10) * 1024
freeMem = parseInt(resultMemory[1], 10) + (parseInt(resultMemory[3], 10) + parseInt(resultMemory[4], 10)) * 1024
freeMem = (parseInt(resultMemory[1], 10) + parseInt(resultMemory[3], 10) + parseInt(resultMemory[4], 10)) * 1024
}

var totalMemMb = parseFloat((totalMem / 1024 / 1024).toFixed(2))
Expand Down

0 comments on commit 4f56e89

Please sign in to comment.