我可以通过 Invoke-RestMethod 从提供以下格式的 API 取回数据:
1612142668000000000 : @{peak_performance=29.18; current_utilization=19.15}
1612146268000000000 : @{peak_performance=29.05; current_utilization=20.03}
1612149868000000000 : @{peak_performance=29.07; current_utilization=18.86}
如果有帮助,上面的 JSON 格式是:
{
"1612142668000000000": {
"peak_performance": 29.18,
"current_utilization": 19.15
},
"1612146268000000000": {
"peak_performance": 29.05,
"current_utilization": 20.03
},
"1612149868000000000": {
"peak_performance": 29.07,
"current_utilization": 18.86
}
}
我希望能够计算和显示所有可用值的平均值peak-performance
,current_utilization
但我不知道如何做到这一点。有任何想法吗?