Welcome to MSDN Blogs Sign in | Join | Help

Looking at historic CPU utilization

I came across this neat little aspect of the Virtual Server COM interface - which would be very handy if you wanted to make your own 'CPU history' graph.  It is the 'CPUUtilizationHistory' object which contains the last 60 CPU utilization measurements for a given virtual machine.

Here is a very simple script that will print out the 60 measurements for a virtual machine (specified via a command line parameter):

Set objVS = CreateObject("VirtualServer.Application")
set objVM = objVS.FindVirtualMachine(WScript.Arguments(0))
Set colAccountants = objVM.Accountant
       
i = 1
For Each intCPUUtilization in colAccountants.CPUUtilizationHistory
    Wscript.Echo i & ": " & intCPUUtilization
    i = i + 1
Next

Cheers,
Ben

Published Thursday, February 23, 2006 9:11 PM by Virtual PC Guy

Comments

Tuesday, February 28, 2006 8:39 AM by Adam C

# re: Looking at historic CPU utilization

I am going to guess that the 60 measurement is the last 60 seconds?

The help page on the graph says
"A graphical representation of the CPU usage by this virtual machine over the previous minute."
is this correct?

Thanks,
Adam
Tuesday, February 28, 2006 4:42 PM by Virtual PC Guy

# re: Looking at historic CPU utilization

Yup.

Cheers,
Ben
New Comments to this post are disabled
 
Page view tracker