Hi Mockey,

thanks for your reply.

> I had a quick look at the plugin-code. get_cpu_usage retrieves
> Processor(_Total)\% Processor Time. 
> Quote:
> if you have a multiprocessor machine, Processor(_Total)\% Processor
> Time actually measures the average processor utilization of your
> machine (i.e. utilization averaged over all processors).
> http://www.windowsnetworking.com/articles_tutorials/Key-Performance-
> Monitor-Counters.html
> 
> It shouldn't be too difficult to change the plugin, so that you
> could add a parameter to get_cpu_usage for the processor number...

I tested again and i am quite sure, that only the value of CPU-0 is 
returned. How to test: i started MS-Calc and assigned the process to 
CPU-1 (via Taskmanager). Then i entered 999999999 in MS-Calc and 
pressed n!, which brings the CPU-1 to 100%, while CPU-0 has nothing 
to do. But GET_CPU_USAGE just displays a low value. But if i assign 
MS-Calc to CPU-0, then GET_CPU_USAGE displays 100%.   


> I can't confirm this but I'm not so much dragging PowerPro-bars
> around. I don't see any performance degradation from the plugin.
> Maybe it's comes from your color switching code...

I also don't drag bars very often. But i drag powerpro-notes quite 
often. It's the same effect for bars and notes. 
I deactivated my color switching-code - still same problem. But when 
i deactivate the call to GET_CPU_USAGE the problem is gone. 


> No idea about systemmeter.
Mike Campbell posted the same problem in January 2005. But the posted 
reply doesn't help me. 


> Should be possible. Easiest way might be using pdh.dll, which offers
> some helper functions for this:
> http://msdn2.microsoft.com/en-us/library/aa373214%28VS.85%29.aspx
> 
> Script could look like this:
> 
> local err, hQuery, counterPath, hCounter
> counterPath = "\\Processor(_Total)\\% Processor Time"
> err = dll.call("pdh.dll|PdhOpenQuery|s! ui ui*", "", 0, "hQuery")
> err = dll.call("pdh.dll|PdhAddCounterA|ui s ui ui*", hQuery,
> counterPath, 0, "hCounter")
> win.debug(win.hex(err))
> err = dll.call("pdh.dll|PdhCollectQueryData|ui", hQuery)
> win.debug(win.hex(err))
> wait.for(1000)
> err = dll.call("pdh.dll|PdhCollectQueryData|ui", hQuery)
> win.debug(win.hex(err))
> err = dll.call("pdh.dll|PdhCloseQuery|ui", hQuery)
> 
> Unfortunately I can't get PdhCollectQueryData to work. Always 
> returns PDH_NO_DATA. Don't know why...

Well that script looks interesting, but i don't understand what's 
going on there. 


Best regards DeLe




Reply via email to