Skip to content
Browse files

more little process viewer changes

  • Loading branch information...
1 parent 36aa3c7 commit af3c28149c102458d9d90d508ed8f9ea5e7a5297 @contra contra committed
Showing with 4 additions and 7 deletions.
  1. +4 −7 bin/top
View
11 bin/top
@@ -2,7 +2,7 @@
var exec = require('child_process').exec;
//$13 should be name?
-var cmd = "ps aux | awk '/chroot_runner/ && !/awk/ {print $3,$4,$2,$5,$6,$10,$8}' | sort -r | head -n 35";
+var cmd = "ps aux | awk '/chroot_runner/ && !/awk/ {print $3,$4,$2,$5,$6,$10,$9}' | sort -r | head -n 50";
require('colors');
@@ -15,23 +15,20 @@ var top = function() {
data.forEach(function(l) {
var line = l.split(' ');
if (line[1]) {
- for (var i = 2; i < 6; i++) {
+ for (var i = 2; i < 7; i++) {
line[i] = line[i].white;
}
- if (parseFloat(line[0]) > 1) {
+ if (parseFloat(line[0]) > 0.75) {
line[0] = line[0].red.bold;
} else {
line[0] = line[0].white;
}
- if (parseFloat(line[1]) > 1) {
+ if (parseFloat(line[1]) > 0.75) {
line[1] = line[1].red.bold;
} else {
line[1] = line[1].white;
}
-
- var tmp = line[6].split(':');
- line[6] = ('[' + tmp[0] + ']:').blue + tmp[1].yellow;
console.log(line.join('\t'));
}

0 comments on commit af3c281

Please sign in to comment.
Something went wrong with that request. Please try again.