System loading, in the sense of UNIX (and if I remember correctly), is the number of processes that can be started that actually are not running on the CPU (averaged over a period of time). Utilities such as topdisplay this load, for example, the last 1, 5 and 15 minutes.
I do not think this is possible with the standard Win32 WMI classes. The process status field (ExecutionState)in WMI objects is Win32_Processdocumented as unused.
(, , , , ). Win32_Thread ExecutionState, :
2 (, , 6, , ), . , .
, ThreadState :
- 0 ( ).
- 1 ( ).
- 2 ().
- 3 Standby ( , ).
- 4 ( ).
- 5 ( , , ).
- 6 ( , ).
- 7 ( ).
1 3.
, , . Microsoft WMI, , : -)
Windows- , 1- , . VBScript WMI - , , CPU , , , .
, - ( VBScript , ):
set objWmi = GetObject("winmgmts:\\.\root\cimv2")
set threadList = objWmi.ExecQuery("select * from Win32_Thread",,48)
sysLoad = 0
for each objThread in threadList
if objThread.ThreadState = 1 or objThread.ThreadState = 3 then
sysLoad = sysLoad + 1
end if
next
' sysLoad now contains number of threads waiting for a CPU. '