Updated on 2025-11-17 GMT+08:00

Querying Statistics of All Running Instances

Function

This API is used to query the statistics of all DCS instances that are in the Running state.

URI

GET /v2/{project_id}/instances/statistic

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description:

Project ID. For details, see Obtaining a Project ID.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

statistics

Array of InstanceStatistic objects

Parameter description:

Statistics of all instances in the Running state.

Value range:

N/A.

Table 3 InstanceStatistic

Parameter

Type

Description

input_kbps

String

Parameter description:

Incoming traffic (Kbit/s) of the DCS instance.

Value range:

N/A.

output_kbps

String

Parameter description:

Outgoing traffic (Kbit/s) of the DCS instance.

Value range:

N/A.

instance_id

String

Parameter description:

Instance ID.

Value range:

N/A.

keys

Long

Parameter description:

Number of cached data records.

Value range:

N/A.

used_memory

Long

Parameter description:

Used memory size in MB.

Value range:

N/A.

max_memory

Long

Parameter description:

Total memory size in MB.

Value range:

N/A.

cmd_get_count

Long

Parameter description:

Number of times the GET command is run.

Value range:

N/A.

cmd_set_count

Long

Parameter description:

Number of times the SET command is run.

Value range:

N/A.

used_cpu

String

Parameter description:

Accumulated CPU time consumed by the cache in the user state and kernel state, in seconds.

Value range:

N/A.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Parameter description:

Error message.

Value range:

N/A.

error_code

String

Parameter description:

Error code.

Value range:

For details, see Error Codes.

error_ext_msg

String

Parameter description:

Extended error information. This parameter is not used currently and is set to null.

Value range:

N/A.

Example Requests

GET https://{dcs_endpoint}/v2/{project_id}/instances/statistic

Example Responses

Status code: 200

Instance statistics queried successfully.

{
  "statistics" : [ {
    "output_kbps" : "0.0",
    "instance_id" : "e008652d-18e0-43ff-924e-072261e0372a",
    "keys" : 0,
    "used_memory" : 0,
    "cmd_get_count" : 0,
    "used_cpu" : "0.0",
    "cmd_set_count" : 0,
    "input_kbps" : "0.0",
    "max_memory" : 460
  }, {
    "output_kbps" : "0.0",
    "instance_id" : "c577a1eb-33b7-42c7-8231-ad32358599ac",
    "keys" : 0,
    "used_memory" : 0,
    "cmd_get_count" : 0,
    "used_cpu" : "0.0",
    "cmd_set_count" : 0,
    "input_kbps" : "0.0",
    "max_memory" : 460
  }, {
    "output_kbps" : "1.19",
    "instance_id" : "e8b98471-55d5-4695-b0bb-8f336a98e207",
    "keys" : 0,
    "used_memory" : 0,
    "cmd_get_count" : 0,
    "used_cpu" : "0.0",
    "cmd_set_count" : 0,
    "input_kbps" : "0.03",
    "max_memory" : 460
  }, {
    "output_kbps" : "0.0",
    "instance_id" : "bc61c690-4b34-4cbe-9ce3-11246aea7aba",
    "keys" : 0,
    "used_memory" : 0,
    "cmd_get_count" : 0,
    "used_cpu" : "0.0",
    "cmd_set_count" : 0,
    "input_kbps" : "0.0",
    "max_memory" : 6963
  } ]
}

Status Codes

Status Code

Description

200

Instance statistics queried successfully.

400

Invalid request.

500

Internal service error.

Error Codes

See Error Codes.