process_tree
Calling
process_tree
exposes a single function that can be called in two ways
Single Callback
process_tree(cb) @cb(err, processes)
Pass/Fail
process_tree(pass, fail) @pass(processes) @fail(err)
processes array
The callbacks return a processes array, each process object is in the index which corresponds to its process id. Any id's for which there are no processes will return undefined.
process object
A process has the following properties
- id :
- the process id
- parent : |
- if the parent is not an active process it returns the process id of the parent, otherwise it returns the process object of the parent
- user :
- UID of the owner
- cpu_percent :
- cpu percentage in use by the process (not including children). Accurate to one tenth of a percent
- children_cpu :
- total cpu percentage in use by the process' decsendents (not including the process). Accurate to one tenth of a percent
- mem_percent :
- memory percentage in use by the process (not including children). Accurate to one tenth of a percent
- children_mem :
- total memory percentage in use by the process' decsendents (not including the process). Accurate to one tenth of a percent
- command :
- the command used to invoke the process
- children : []
- An array of all the processes that declare this process as their parent