Stats shown in vCenter don't match same stats in PowerCLI

In vCenter, if I do [VM] -> Monitor -> Advanced and set it to Disk -> Highest Latency -> Last week, it returns (for example) a minimum/average/maximum of 0/13/271. However, if I do the same thing in PowerCLI, I get 0/10/144.

Here's the relevant part of my script:

$currentDate = Get-Date
$stats = Get-Stat -Entity $vm -Stat disk.maxTotalLatency.latest -Start $currentDate.AddDays(-7) -Finish $currentDate
$diskLatencyMin = $stats.value | sort | select -First 1
$diskLatencyMax = $stats.value | sort | select -Last 1
[int]$diskLatencyAvg = (($stats.value | Measure-Object -Sum).Sum)/$stats.count

Is either vCenter or PowerCLI just not reliable for gathering this info, or am I doing something wrong in the script?

Labels (2)
0 Kudos
0 Replies