Something appears to be off in the math. Max and averages appear to be about half what I can see in vCenter for the same period.
Any chance you can briefly describe the logic / loops above and I'll have a go at troubleshooting the discrepancy.
Plus, it doesn't appear to store or calculate any aggregated peaks across multiple hosts. But I can work that out from this point.
Cheers, I'll have a crack at modifying it to suit.