Comparing version 0.1.6 to 0.1.7
{ | ||
"name": "vtop", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Wow such top. So stats", | ||
@@ -5,0 +5,0 @@ "homepage": "http://parall.ax/vtop", |
@@ -36,3 +36,3 @@ /** | ||
'CPU %': '0.4', | ||
'Memory': '100 MB' | ||
'Memory %': '1' | ||
}, { | ||
@@ -42,3 +42,3 @@ 'Command': 'Sublime Text 2', | ||
'CPU %': '0.1', | ||
'Memory': '200MB' | ||
'Memory': '5' | ||
}], | ||
@@ -53,2 +53,5 @@ | ||
var stats = {}; | ||
// @todo If you can think of a better way of getting process stats, | ||
// then please feel free to send me a pull request. This is version 0.1 | ||
// and needs some love. | ||
var ps = child_process.exec('ps -ewwwo %cpu,%mem,comm', function (error, stdout, stderr) { | ||
@@ -59,3 +62,3 @@ var lines = stdout.split("\n"); | ||
for (var line in lines) { | ||
var currentLine = lines[line].trim(); | ||
var currentLine = lines[line].trim().replace(' ', ' '); | ||
//console.log(currentLine); | ||
@@ -65,4 +68,4 @@ var words = currentLine.split(" "); | ||
var cpu = words[0]; | ||
var mem = words[2]; | ||
var offset = cpu.length + mem.length + 3; | ||
var mem = words[1]; | ||
var offset = cpu.length + mem.length + 2; | ||
var comm = currentLine.slice(offset); | ||
@@ -69,0 +72,0 @@ // If we're on Mac then remove the path |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1929530
582