soyuka / pidusage

Cross-platform process cpu % and memory usage of a PID
MIT License
512 stars 55 forks source link

[WIP] Fix cpu percentage on multi threaded processes #61

Closed simonepri closed 6 years ago

simonepri commented 6 years ago

See the following: https://nodejs.org/api/process.html#process_process_cpuusage_previousvalue https://stackoverflow.com/a/16736599/3921589 https://github.com/soyuka/pidusage/pull/60#issuecomment-396338566 https://github.com/soyuka/pidusage/pull/60#issuecomment-396334892 https://github.com/soyuka/pidusage/issues/58 https://github.com/Unitech/pm2/issues/3708

codecov-io commented 6 years ago

Codecov Report

Merging #61 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #61   +/-   ##
=======================================
  Coverage   92.57%   92.57%           
=======================================
  Files           9        9           
  Lines         283      283           
=======================================
  Hits          262      262           
  Misses         21       21
Impacted Files Coverage Δ
lib/ps.js 95.34% <ø> (ø) :arrow_up:
lib/procfile.js 100% <ø> (ø) :arrow_up:
lib/wmic.js 89.28% <ø> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e3f0c05...eb478da. Read the comment docs.

soyuka commented 6 years ago

These values measure time spent in user and system code respectively, and may end up being greater than actual elapsed time if multiple CPU cores are performing work for this process.

This should be true indeed. We may need to add this to the readme.