Querying Tenant-Level Function Statistics
Function
This API is used to query tenant-level function statistics.
The statistics include function format, quota and usage, and traffic report.
You can query data in a specific period using the filter and period parameters.
URI
GET /v2/{project_id}/fgs/functions/statistics
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
filter |
Yes |
String |
Parameter filter.
Enumeration values:
|
period |
No |
String |
The unit is minute. This parameter must be used together with the filter parameter metric. |
option |
No |
String |
Monthly statistical period. This parameter is valid only when filter is set to monthly_report. If a value beyond the preceding range is specified, the default value 0 will be used.
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
count |
Array of MonthUsed objects |
Number of monthly invocations. |
gbs |
Array of MonthUsed objects |
Monthly resource usage. |
statistics |
Function Metrics |
Parameter |
Type |
Description |
---|---|---|
count |
Array of SlaReportsValue objects |
Function invocations. |
duration |
Array of SlaReportsValue objects |
Average latency, in milliseconds. |
fail_count |
Array of SlaReportsValue objects |
Number of errors. |
max_duration |
Array of SlaReportsValue objects |
Maximum latency, in milliseconds. |
min_duration |
Array of SlaReportsValue objects |
Minimum latency, in milliseconds. |
reject_count |
Array of SlaReportsValue objects |
Number of throttles. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
Query tenant-level function statistics.
GET /v2/{project_id}/fgs/functions/statistics
Example Responses
Status code: 200
Query successful.
{ "statistics" : { "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 |
Query successful. |
400 |
Bad Request |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot