Updated on 2024-04-01 GMT+08:00

Monitoring the Read/Write Ratio

Function

This API is used to query reads and writes of a DDM instance in a specified time range.

This API will become unavailable on April 30, 2024.

Constraints

None

URI

GET /v2/{project_id}/instances/{instance_id}/read-write-ratio

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

instance_id

Yes

String

DDM instance ID

Table 2 Query parameters

Parameter

Mandatory

Type

Description

curPage

Yes

String

Which page the server starts returning items. The start value cannot be less than 0.

perPage

Yes

String

Number of records displayed on each page

startDate

Yes

String

Start time in UTC, accurate to milliseconds

endDate

Yes

String

End time in UTC, accurate to milliseconds The interval between the start time and the end time must be no more than 1 month.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

totalRecord

Integer

Number of read/write ratio records on DDM

readWriteRatioList

Array of ReadWriteRatioList objects

Read/Write ratio records on DDM

Table 5 ReadWriteRatioList

Parameter

Type

Description

schema

String

Schema name

table

String

Logical table name

readCount

String

Reads

writeCount

String

Writes

relationTables

String

Associated table

lastUpdated

String

Time when the read/write ratio is last updated

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

errCode

String

Service error code

externalMessage

String

Error message

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

errCode

String

Service error code

externalMessage

String

Error message

Example Request

GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/read-write-ratio?curPage={curPage}&perPage={perPage}&startDate={startDate}&endDate={endDate}

Example Response

Status code: 200

OK

{
  "totalRecord" : 2,
  "readWriteRatioList" : [ {
    "schema" : "xxxx",
    "table" : "xxxx",
    "readCount" : "215",
    "writeCount" : "46",
    "relationTables" : "xxxx",
    "lastUpdated" : "1619404869724"
  } ]
}

Status code: 400

bad request

{
  "externalMessage" : "Parameter error.",
  "errCode" : "DBS.280001"
}

Status code: 500

server error

{
  "externalMessage" : "Server failure.",
  "errCode" : "DBS.200412"
}

Status Codes

Status Code

Description

200

OK

400

bad request

500

server error

Error Codes

For details, see Error Codes.