ultra-runner
Advanced tools
Comparing version 2.2.1 to 2.3.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [2.3.0](https://github.com/folke/ultra-runner/compare/v2.2.1...v2.3.0) (2020-03-15) | ||
### Features | ||
* ✨ sort by total cpu for parent process including its children ([755dc60](https://github.com/folke/ultra-runner/commit/755dc6030f43094f6f00f72f8652aeb654fda637)) | ||
### [2.2.1](https://github.com/folke/ultra-runner/compare/v2.2.0...v2.2.1) (2020-03-15) | ||
@@ -7,0 +14,0 @@ |
@@ -65,2 +65,6 @@ "use strict"; | ||
} | ||
function getTotalCpu(proc) { | ||
return ((proc.cpu || 0) + | ||
proc.children.reduce((p, c) => (getTotalCpu(c) || 0) + p, 0)); | ||
} | ||
function getProcessTree() { | ||
@@ -80,3 +84,3 @@ return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
.filter(proc => !children.has(proc.pid)) | ||
.sort((a, b) => (b.cpu || 0) - (a.cpu || 0)); | ||
.sort((a, b) => getTotalCpu(b) - getTotalCpu(a)); | ||
}); | ||
@@ -120,3 +124,3 @@ } | ||
`${chalk_1.default.magenta(proc.pid)}`, | ||
(((_a = proc.cpu) !== null && _a !== void 0 ? _a : 0) > 10 ? chalk_1.default.red : chalk_1.default.green)(`${proc.cpu}%`), | ||
(((_a = proc.cpu) !== null && _a !== void 0 ? _a : 0) > 10 ? chalk_1.default.red : chalk_1.default.green)(`${proc.cpu}%`.padEnd(5)), | ||
(((_b = proc.memory) !== null && _b !== void 0 ? _b : 0) > 10 ? chalk_1.default.red : chalk_1.default.green)(`${proc.memory}%`), | ||
@@ -123,0 +127,0 @@ chalk_1.default.blue(proc.project ? proc.project : ""), |
{ | ||
"name": "ultra-runner", | ||
"description": "Smart and beautiful script runner that hijacks any `npm run`, `yarn` and `npx` calls for ultra fast execution", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "repository": "http://github.com/folke/ultra-runner", |
Sorry, the diff of this file is not supported yet
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
193894
2100