使用数据可通过Azure Monitor REST API获得.有关如何使用此API的一般概述,请参见此处.
相关指标是FunctionExecutionUnits.此单位为MB毫秒,因此要将其转换为GB秒,您需要将值除以1,024,000.以下是检索功能应用的每分钟使用数据的示例查询:
GET /subscriptions/<subid>/resourcegroups/<rg>/providers/Microsoft.Web/sites/<appname>/providers/microsoft.insights/metrics?api-version=2016-06-01&$filter=(name.value eq 'FunctionExecutionUnits') and timeGrain eq duration'PT1M' and startTime eq 2016-12-10T00:00:00Z and endTime eq 2016-12-10T00:05:00Z and (aggregationType eq 'Total')
Run Code Online (Sandbox Code Playgroud)
你会得到这样的东西:
{
"value": [
{
"data": [
{
"timeStamp": "2016-12-10T00:00:00Z",
"total": 0
},
{
"timeStamp": "2016-12-10T00:01:00Z",
"total": 140544
},
{
"timeStamp": "2016-12-10T00:02:00Z",
"total": 0
},
{
"timeStamp": "2016-12-10T00:03:00Z",
"total": 0
},
{
"timeStamp": "2016-12-10T00:04:00Z",
"total": 0
}
],
"name": {
"value": "FunctionExecutionUnits",
"localizedValue": "Function Execution Units"
},
"type": "Microsoft.Insights/metrics",
"unit": "0"
}
]
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
899 次 |
| 最近记录: |