Updated on 2024-11-06 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 /v1.0/{project_id}/instances/statistic

Table 1 describes the parameter.
Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID

Request

Request parameters

None.

Example request

GET https://{dcs_endpoint}/v1.0/{project_id}/instances/statistic

Response

Response parameters

Table 2 describes the response parameter.
Table 2 Parameter description

Parameter

Type

Description

statistics

Array

Statistics of all instances in the Running state. For details, see Table 3.

Table 3 statistics parameter description

Parameter

Type

Description

keys

Integer

Number of cached data records

instance_id

String

DCS instance ID

used_memory

Integer

Size of the used memory in MB

max_memory

Integer

Overall memory size in MB

cmd_get_count

Integer

Number of times the GET command is run

cmd_set_count

Integer

Number of times the SET command is run

used_cpu

String

Percentage of CPU usage

input_kbps

String

Incoming traffic (KB/s) of the DCS instance

output_kbps

String

Outgoing traffic (KB/s) of the DCS instance

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

Status Code

Table 4 describes the status code of successful operations. For details about other status codes, see Table 1.

Table 4 Status code

Status Code

Description

200

Statistics of all instances queried successfully.