Help Center/ GaussDB(DWS)/ API Reference/ API Description/ Host Monitoring/ Obtains the collected data of a specified metric.
Updated on 2024-04-18 GMT+08:00

Obtains the collected data of a specified metric.

Function

This API is used to obtain the collected data of a specified metric.

Call Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/clusters/{cluster_id}/dms/metrics/{metric_name}
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the ID, see Obtaining Project ID.

cluster_id

Yes

String

Cluster ID. For details about how to obtain the ID, see Obtaining the Cluster ID.

metric_name

Yes

String

Metric name

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

Yes

Integer

Offset from which the query starts, which is greater or equal to 0.

limit

Yes

Integer

Number of items displayed on each page. The maximum value is 1000.

from

Yes

Long

Collection start time, which is a 13-digit timestamp.

to

Yes

Long

Collection end time, which is a 13-digit timestamp. The period from the start time to the end time cannot exceed one day.

order_by

No

String

Sorting field This parameter is set to a fixed value.

  • ctime: indicates the collection time.

sort_by

No

String

Ascending or descending. This parameter is set to a fixed value.

  • asc: ascending order.
  • desc: reverse order.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

code

Integer

Response code

msg

String

Response message

data

Array of Map<String,String> objects

Indicates the list of collected metric data. For details, see User-defined Counter List.

count

Long

Total list size

Example Request

https://{Endpoint}/v1/{project_id}/clusters/{cluster_id}/dms/metrics/TableDirtyPageRate?limit=1&offset=0&from=1701914324000&to=1701942194000&order_by=ctime&sort_by=desc

Example Response

Status code: 200

Querying Indicator Collection Data Objects

{
  "code" : 0,
  "msg" : "OK",
  "data" : [ {
    "table_size" : 40960,
    "virtual_cluster_id" : 53,
    "db_name" : "postgres",
    "ctime" : 1701929836000,
    "table_owner" : "Ruby",
    "schema_name" : "pmk",
    "table_name" : "pmk_meta_data",
    "dirty_page_rate" : 0.8
  } ],
  "count" : 3
}

Status Code

Status Code

Description

200

Succeeded in querying the data collection object of the specified metric.

400

Request error.

401

Authentication failed.

403

You do not have required permissions.

404

No resources found.

500

Internal server error.

503

Service unavailable.