[DAEMON-35] appcd-core: Replace "pidusage" with "process.cpuUsage()"
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2017-02-16T06:48:52.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Appc Daemon 1.0.0 |
Components | appcd-core |
Labels | n/a |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2016-10-31T17:23:53.000+0000 |
Updated | 2017-02-17T16:39:33.000+0000 |
Description
The daemon uses a NPM module called "pidusage" to monitor the CPU usage, but this is no longer necessary since Node 6 includes a built-in
process.cpuUsage()
function. https://nodejs.org/dist/latest-v6.x/docs/api/process.html#process_process_cpuusage_previousvalue
Aside from removing a dependency, it's going to be more efficient to use Node's built-in process.cpuUsage()
because "pidusage" relies on file I/O and spawning ps
and wmic
.
No comments