Querying Tenant-Level Function Statistics
Function
This API is used to query tenant-level function statistics.
URI
GET /v2/{project_id}/fgs/functions/statistics
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Tenant's project ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| filter | Yes | String | Parameter filter. Enumeration values:
|
| period | No | String | Period. Unit: minute. This parameter is valid only when filter is set to monitor_data. |
| option | No | String | Monthly statistical period. This parameter is valid only when filter is set to monthly_report. 0: Statistics of the current month are counted. 1: Statistics of the last month are counted. 2: Statistics of the last three months are counted. 3: Statistics of the last six months are counted. If you specify a value which is out of the preceding range, the default value 0 will be used. Enumeration values:
|
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| count | Array of MonthUsed objects | Number of monthly function invocations. |
| gbs | Array of MonthUsed objects | Monthly function resource usage. |
| statistics | ListFunctionStatisticsResp object | Function metric. |
| 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/statistics 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: Obtaining Function Running Metrics in a Specified Period
Next Article: Updating a Trigger
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.