Shoutbox

CPU usage - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: WLM Plus! Help (/forumdisplay.php?fid=12)
+----- Thread: CPU usage (/showthread.php?tid=75510)

CPU usage by Workin on 06-21-2007 at 04:44 PM

I was thinking.  You know what would be great.
If you could set, your status to busy if your cpu went over 80% or 90% used.
Is there a way to do that in plus?
thanks


RE: CPU usage by Chris4 on 06-21-2007 at 06:10 PM

I'm sure it can be done.

Computer Details can find how much memory is being used, so I can't see it will be that hard to make your status change to busy if it goes over a certain amount.


RE: CPU usage by absorbation on 06-22-2007 at 04:08 PM

The problem with a script like this, is it's too small and well, useless. I notice changing my status to busy won't change my CPU usage, and people still are happy to start conversations with me :P.


RE: CPU usage by CookieRevised on 06-22-2007 at 04:58 PM

quote:
Originally posted by Chris4
I'm sure it can be done.

Computer Details can find how much memory is being used, so I can't see it will be that hard to make your status change to busy if it goes over a certain amount.
Memory and cpu usage are two completely different things...

Memory is in no way a good status indicator. As for cpu usage, that can be very tricky to properly detect. Especially the method used in the ComputerDetails script; it doesn't always work for all processors and is slow (too slow for decent monitoring).

------

Anyways, cpu usage isn't the best thing to base your status on either (it's better than memory, but still). On a normal computer your CPU usage fluctuates a hell of a lot and a cpu usage of close to 100% does not mean you can't do anything else.

Moreover, in many cases the cpu usage only stays high a very short time (eg: starting up programs). Do you want your status changed each time because you simply start a program?

This could be solved by monitoring the cpu usage over a period of time, and when it stays above a certain treshold trigger the status change. But.... this wont work properly, because in order to monitor the cpu load constantly (aka polling; which is in almost all cases not a good thing todo) you need to use the cpu constantly, so you'd actually create some cpu load with the script itself...

So, not impossible to make, but very tricky to get it right (eg: polling too much and you actually will change your status the moment you start the script, polling too little and you wont be able to detect a constant cpu load) and it's probably very highly computer dependant (what works decent on one pc, wont work decent on the other). Not to mention you need a fast and reliable way to detect cpu load (wmi isn't very reliable in this context, seeing the ComputerDetails script where the cpu related variables wont work in 3/4 pc's here).