Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Mon, 14 Apr 2008 02:06:03 -0700,    group: microsoft.public.win32.programmer.wmi        back       


Wrong CPU percentage   
Hello, 

We are working on the calculation of the CPU %, for this purpose we use a 
query to obtain the values of the class WMI 
Win32_PerfRawData_PerfOS_Processor. Those values are the PercentProcessorTime 
and Timestamp_syn10n, with which we carry out the calculation. 

For the calculation be made a subtraction between the current value of 
PercentProcessorTime and above of this formulation:

100 * (1 – (N2-N1)/(T2-T1))

Where N2 is Current PercentProcessorTime,
      N1 is Previous PercentProcessorTime,
      T2 is Current Timestamp_syn10n,
T1 is Previous Timestamp_syn10n.

First a question: We know that the values of the variable 
PercentProcessorTime are cumulative, we might want to know the behaviour if 
we continue monitoring the computer indefinitely because in some time the 
values will be reset.  The question is: Which are the maximum?. Furthermore, 
we have noticed that after starting the computer the first retrived value 
seems not starting from zero.  Which is the minimum value?  


Now a wrong behaviour: In some tests we retrieve some strange values (in 
random measurements) when monitoring two computers. For example, monitoring a 
computer every 60 seconds we sometimes get this kind of values:

Current PercentProcessorTime: 2134687500, (UINT64) 
Previous PercentProcessorTime: 555334062500, (UINT64)
Subtraction: -5.531994e+011, (long double)

Current Timestamp_syn10n: 128523767044700060, (UINT64)
Previous Timestamp_syn10n: 128523757912265245, (UINT64)
Subtraction: 9.132435e+009,(long double)

Result CPU is: 5900% (Int)


As you can see, the previous value is much greater than the current one.  
This should be impossible but it happens (we don’t know how to reproduce this 
problem because this happens 1 or 2 times a day). 

The machine where we obtain the data it is a machine with Dual Processor 
with Windows XP sp2 operating system (Spanish version).  Did you know this 
bug (because I suppose this is a bug)?  Any ideas about what can look for to 
give you more information about the “bug”?

Regards,
Tango
date: Mon, 14 Apr 2008 02:06:03 -0700   author:   Tango am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us