Syntax
Get-Stat [-Entity] <VIObject[]> [-Common] [-Memory] [-Cpu] [-Disk] [-Network] [-Stat <String[]>] [-Start <DateTime>] [-Finish <DateTime>] [-MaxSamples <Int32>] [-IntervalMins <Int32>] [-IntervalSecs <Int32>] [-Instance <String[]>] [-Realtime] [<CommonParameters>]Related Commands
Online versionDetailed Description
Retrieves the statistical information available on a vSphere server for each provided entity. For example, if the CPU parameter is set to $true, collects the average CPU usage and the average CPU usagemhz counters as appropriate for each entity. If the Stats parameter is set to $true, collects all provided named stats counters. Counters are provided using a dotted notation of the form "counter group"."counter name"."rollup type". For example: "cpu.usage.min". The cmdlet uses the Start time, if provided, and the Finish time, if provided, along with the MaxSamples, if provided, to bound the data collection. If intervalSecs is provided, the closest matching available interval is used. For each statistics sample on the server, the cmdlet returns a Sample object. The Instance property of the Sample object shows the serial number of the device for which a statistics value is taken. If the Instance property is empty ("), this indicates that the statistics sample contains an average statistic value for all specified devices. If you are connected to a vCenter Server and Get-Stat is run for a host entity, the cmdlet returns only the statistics available on the vCenter Server.Parameters
Return Type
SampleNotes
Samples are not generated for a virtual machine while it is powered off.Examples
-------------- Example 1 --------------
Get-Stat -Entity VM -Start 5/5/2008 -Finish 7/10/2008 -Disk -IntervalSecs 300
Prints the disk statistics for the specified time interval for the first virtual machine, retrieved by the Get-VM cmdlet.
-------------- Example 2 --------------
Get-Stat ?Entity Host ?Cpu ?Instance 0, "
Retrieves the cumulative statistics for a multiprocessor host and the CPU statistics for the first processor.