astrofrog / psrecord

Record the CPU and memory activity of a process :chart_with_upwards_trend:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--include-children It seems not working with % CPU usage

rubenmulero opened this issue · comments

Hello.

I'm trying to monitor a Parent process that uses 21 child processes and I can't obtain the % CPU usage. The library returns me the % MEM usage but it doesn't returns the %CPU usage.

I tested using a UWSGI instance with 21 processes. All processes increase the CPU usage to 100%, but, for some reason the library is not including the CPU usage of child processes.

I used the command:

psrecord $1 --log results_${2}seconds.txt --include-children --duration $2

Where $1 is the PID and $2 is the duration of the test.

Elapsed time CPU (%) Real (MB) Virtual (MB)

   0.000        0.000     1695.492     9395.965
   0.278        0.000     1695.492     9395.965

I'm doing something wrong?

Hello.

As far as I can see the problem is related with psutil library. I have made some tests and the problem seems to be in psutil. So this can be closed.

Regards.

@rubenmulero #56 fixed it for me