pidusage icon indicating copy to clipboard operation
pidusage copied to clipboard

cpu value returns zero

Open Paul-Reed opened this issue 1 year ago • 3 comments

Hi, I'm using your library on a Oracle Cloud VM.Standard.A1.Flex server, with Canonical-Ubuntu-22.04 OS. Unfortunately, it does not return the "cpu" value, and for every child process the result is "cpu":0. There are no errors in the logfile and the other metrics appear to display correctly.

Is this a known compatibility issue?

Paul-Reed avatar Mar 26 '23 19:03 Paul-Reed

Hi, I am having a similar issue.

Originally I mentioned the issue on a module that uses your library: https://github.com/bartbutenaers/node-red-contrib-process-resources/issues/1#issuecomment-1493780871 Node Red for reference here: https://discourse.nodered.org/t/node-red-kept-restarting-upon-git-push/77181

The issue shows in my log like this: 3 Apr 08:06:09 - [red] Uncaught Exception: 3 Apr 08:06:09 - [error] TypeError: Cannot read properties of null (reading 'cpu') at /data/node_modules/node-red-contrib-process-resources/process_resources.js:61:75 at Array.forEach () at sendMessage (/data/node_modules/node-red-contrib-process-resources/process_resources.js:59:33) at /data/node_modules/node-red-contrib-process-resources/process_resources.js:113:25 at /data/node_modules/pidusage/lib/stats.js:90:7 at each (/data/node_modules/pidusage/lib/helpers/parallel.js:24:15) at /data/node_modules/pidusage/lib/helpers/parallel.js:32:9 at /data/node_modules/pidusage/lib/procfile.js:111:14 at /data/node_modules/pidusage/lib/procfile.js:43:5 at FSReqCallback.wrapper [as oncomplete] (node:fs:660:5)

https://github.com/bartbutenaers/node-red-contrib-process-resources put a workaround in place, but the author suggested that you check in your library.

Please let us know if you need more details.

cameo69 avatar Apr 04 '23 10:04 cameo69

feel free to add the Red compatibility to this project

soyuka avatar Apr 04 '23 12:04 soyuka

There seems to be a bug here still, see thread in https://github.com/Unitech/pm2/issues/5182.

titanism avatar Jun 06 '24 04:06 titanism