Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 207710

How to get CPU Ready in percentage ?

$
0
0

Hi people,

 

When I read this blog from Mr. Epping http://www.yellow-bricks.com/esxtop/ it seems that the CPU ready is stated in % percentage, while in the vsphere console Performace | Advanced tab, it only shows you in milliseconds per 20 seconds.

 

So can anyone here assist me in creating or modifying the script (created by Luc D) to calculate the CPU Ready in percentage ?

 

$metrics = "cpu.usage.average","cpu.ready.summation","cpu.swapwait.summation","mem.active.average"
$entities = Get-VM -Name
$start = (Get-Date).AddDays(-5)
$report = Get-Stat -Entity $entities -Stat $metrics -Realtime -Start $start |
Group-Object -Property EntityId,Timestamp | %{
    New-Object PSObject -Property @{
        Name = $_.Group[0].Entity.Name
        Time = $_.Group[0].Timestamp
        CpuAvg = ($_.Group | where {$_.MetricId -eq "cpu.usage.average"}).Value
        CpuRdy = ($_.Group | where {$_.MetricId -eq "cpu.ready.summation" -and $_.Instance -eq ""}).Value
        CpuSwpWait = ($_.Group | where {$_.MetricId -eq "cpu.swapwait.summation" -and $_.Instance -eq ""}).Value
        MemActAvg = ($_.Group | where {$_.MetricId -eq "mem.active.average"}).Value
    }
}
$report | Sort-Object Name,Time | Export-Csv "C:\VMstats.csv" -NoTypeInformation -UseCulture

 

 

 

Any kind of help would be greatly appreciated.

 

Thanks.


Viewing all articles
Browse latest Browse all 207710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>