Help Center> FunctionGraph> API Reference> Function Management Zone API> Querying Tenant-Level Function Statistics

Querying Tenant-Level Function Statistics

Function

This API is used to query tenant-level function statistics.

URI

GET /v2/{project_id}/fgs/functions/statistics

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant's project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

filter

Yes

String

Parameter filter.

Enumeration values:

  • monitor_data

  • monthly_report

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:

  • 0

  • 1

  • 2

  • 3

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

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.

Table 4 MonthUsed

Parameter

Type

Description

date

String

Date.

value

Integer

Used volume.

Table 5 ListFunctionStatisticsResp

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.

Table 6 SlaReportsValue

Parameter

Type

Description

timestamp

Integer

Timestamp.

value

Integer

Value.

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.