Skip to content

Commit

Permalink
fix available memory. was using free memory as avail
Browse files Browse the repository at this point in the history
  • Loading branch information
jgresham committed Feb 8, 2023
1 parent d89e4c9 commit ecf2517
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const memory = async (req) => {
const { stdout, stderr } = await exec("free -m");
const output = stdout.split("\n")[1]; // get the second line of output
const totalMemory = output.split(/\s+/)[1]; // get the second column (total memory)
const availableMemory = output.split(/\s+/)[3]; // get the fourth column (avail. memory)
const availableMemory = output.split(/\s+/)[6]; // get the seventh column (avail. memory)
const totalMemoryNumMB = parseInt(totalMemory)
const availableMemoryNumMB = parseInt(availableMemory)
const totalMemoryNumGB = rnd(totalMemoryNumMB/1000)
Expand Down Expand Up @@ -361,7 +361,7 @@ const internetSpeed = async (req) => {
}

if(req?.dataCap) {
console.log(warning(`Speedometer cannot test your data cap.\nA data cap minimum of ${req?.dataCap.minimum}TB, but recommended ${req?.dataCap.recommended}TB or more.`))
console.log(warning(`Speedometer cannot test your data cap.\nRequires a data cap minimum of ${req?.dataCap.minimum}TB, but recommended ${req?.dataCap.recommended}TB or more.`))
}
return results;
} catch(error) {
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": "speedometer",
"version": "1.2.3",
"version": "1.2.4",
"description": "measures various speeds of a container environment",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit ecf2517

Please sign in to comment.