NEC Express5800/R120b-2 Guide de l'utilisateur Page 550

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 556
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 549
I-8 Accessing Power and Performance Data
PROCESSOR UTILIZATION
To collect the utilization of processors, use Win32_PerfFormattedData_PerfOS_Processor class
provided with the Windows OS.
Shown below is a sample file created by Visual Basic Script (e.g. Proc.vbs).
In this script, the processor utilization is collected every 30 seconds.
' Start Script
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
set objRefresher = CreateObject("WbemScripting.Swbemrefresher")
Set objProcessor = objRefresher.AddEnum _
(objWMIService, "Win32_PerfFormattedData_PerfOS_Processor").objectSet
objRefresher.Refresh
Dim first
first = true
Do
For each intProcessorUse in objProcessor
If first Then
If intProcessorUse.Name = "_Total" Then
first = false
End If
else
Wscript.Echo "Proc" & intProcessorUse.Name & " : " & _
"PercentProcessorTime=" & _
intProcessorUse.PercentProcessorTime
End If
Next
Wscript.Sleep 30*1000 'sleep 30 * 1000ms
objRefresher.Refresh
Loop
' End Script
Command Line (Example)
C:\VBS> cscript //nologo Proc.vbs
Vue de la page 549

Commentaires sur ces manuels

Pas de commentaire