Obtaining Function Running Metrics in a Specified Period
Function
This API is used to obtain the function running metrics in a specified period.
URI
GET /v2/{project_id}/fgs/functions/{func_urn}/statistics/{period}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Tenant's project ID. |
| func_urn | Yes | String | Function URN. |
| period | Yes | String | Time range specified to obtain function execution metrics. Enumeration values:
|
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| count | Array of SlaReportsValue objects | Number of function invocations. |
| duration | Array of SlaReportsValue objects | Average duration of function invocation. Unit: ms. |
| fail_count | Array of SlaReportsValue objects | Number of invocation errors. |
| max_duration | Array of SlaReportsValue objects | Maximum duration of function invocation. Unit: ms. |
| min_duration | Array of SlaReportsValue objects | Minimum duration of function invocation. Unit: ms. |
| reject_count | Array of SlaReportsValue objects | Number of function throttles. |
Example Requests
PUT https://{functiongraph_endpoint}/v2/7aad83af3e8d42e99ac194e8419e2c9b/fgs/functions/urn:fss:cn-north-4:35f6ceaa17ca4c239538265a0f823423:function:Acception:testnodejs12:latest/statistics/60 Example Responses
Status code: 200
ok
{
"count" : [ {
"timestamp" : 1596679200000,
"value" : -1
}, {
"timestamp" : 1596682800000,
"value" : 2
}, {
"timestamp" : 1596686400000,
"value" : -1
} ],
"duration" : [ {
"timestamp" : 1596679200000,
"value" : -1
}, {
"timestamp" : 1596682800000,
"value" : 950
}, {
"timestamp" : 1596686400000,
"value" : -1
} ],
"fail_count" : [ {
"timestamp" : 1596679200000,
"value" : -1
}, {
"timestamp" : 1596682800000,
"value" : 0
}, {
"timestamp" : 1596686400000,
"value" : -1
} ],
"max_duration" : [ {
"timestamp" : 1596679200000,
"value" : -1
}, {
"timestamp" : 1596682800000,
"value" : 740
}, {
"timestamp" : 1596686400000,
"value" : -1
} ],
"min_duration" : [ {
"timestamp" : 1596679200000,
"value" : -1
}, {
"timestamp" : 1596682800000,
"value" : 210
}, {
"timestamp" : 1596686400000,
"value" : -1
} ],
"reject_count" : [ {
"timestamp" : 1596679200000,
"value" : -1
}, {
"timestamp" : 1596682800000,
"value" : 0
}, {
"timestamp" : 1596686400000,
"value" : -1
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | ok |
Error Codes
See Error Codes.
Last Article: Querying a Resource Quota
Next Article: Querying Tenant-Level Function Statistics
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.