KrispyCamel4u / SysMonTask

Linux system monitor with the compactness and usefulness of windows task manager to allow higher control and monitoring.
BSD 3-Clause "New" or "Revised" License
678 stars 59 forks source link

Stop using popen to calculate the number of threads - addresses #21 #85

Closed magnus-ISU closed 2 years ago

magnus-ISU commented 2 years ago

Obviously doesn't fix it, but it removes one of the calls at least, and one of the more important ones as this was happening every time it updated.

Also fixes a bug in the initial program, where it would display Threads: NUM_THREADS+NUM_PROCESSES rather than just the number of threads because it ran ps axms rather than ps axH.

Let me know if you want me to remove the (pretty useless) comments, or if there is a better way to get the number of loops of the iterator.

KrispyCamel4u commented 2 years ago

Hi, Thanks. I will look into this, surely you have given some good explanation that jirib didn't provide. The next release series(v2.) will follow more professional approach(or at least I will try as much).

magnus-ISU commented 2 years ago

Alright. Let me know if there is anything you want me to do specifically for this pull request that isn't done yet. I will also try to see if I can get some others done, a couple of them that are just using cat and grep probably won't be much work to replace either

KrispyCamel4u commented 2 years ago

Hi, this looks good, but I don't want to merge directly with the master, so can you please modify the pull request to the v1.x.x branch.

KrispyCamel4u commented 2 years ago

Alright. Let me know if there is anything you want me to do specifically for this pull request that isn't done yet. I will also try to see if I can get some others done, a couple of them that are just using cat and grep probably won't be much work to replace either

using directly python is better. I am vewing your changes, there are some other popen calls in net.py, disk.py and mem.py(dmicecode) may you can help in removing those calls also. Thanks in advance.

magnus-ISU commented 2 years ago

The other calls are trickier. I'm not sure exactly how to do them, the easiest I think would be replacing the ones in disk.py but I didn't see an exact corollary and needed to study the code more.