Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Sessions (RDS for MySQL)/ Querying Real-Time Statistics of Killing Sessions (RDS for MySQL)
Updated on 2025-12-09 GMT+08:00

Querying Real-Time Statistics of Killing Sessions (RDS for MySQL)

Function

This API is used to query real-time statistics of a DB instance's killing sessions.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

rds:instance:listAll

read

-

-

rds:instance:list

-

Constraints

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/ops/intelligent-kill-session/statistic

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    The value cannot be empty.

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    Definition

    Instance ID, which uniquely identifies an instance.

    Constraints

    N/A

    Range

    The value can contain 36 characters. Only letters and digits are allowed.

    Default Value

    N/A

    Table 2 Parameters

    Parameter

    Mandatory

    Type

    Description

    node_id

    No

    String

    Definition

    Node ID.

    Constraints

    This parameter is valid only for cluster instances.

    Range

    N/A

    Default Value

    N/A

Request

None

Example Request

Query real-time statistics of killing sessions of a DB instance.

GET https://{Endpoint}/v3/54623db08b174c858ba779d2aa7923a3/instances/aa650a108f034e83b24486fd1ff7be2fin01/ops/intelligent-kill-session/statistic

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    statistics

    Array of objects

    Definition

    Statistics based on different policies.

    For details, see Table 4.

    Table 4 statistics element structure description

    Parameter

    Type

    Description

    keyword

    String

    Definition

    Throttling keyword extracted based on a statistics policy.

    Range

    N/A

    raw_sql

    String

    Definition

    Example SQL statement that matches the SQL throttling keyword.

    Range

    N/A

    ids

    Array of longs

    Definition

    IDs of threads that meet the statistics policy.

    Range

    N/A

    count

    Integer

    Definition

    Total number of the thread IDs.

    Range

    N/A

    total_time

    Double

    Definition

    Total execution time of the threads.

    Range

    N/A

    avg_time

    Double

    Definition

    Average execution time of the threads.

    Range

    N/A

    max_time

    Double

    Definition

    Maximum execution time of the threads.

    Range

    N/A

    strategy

    String

    Definition

    Statistics policy.

    Range

    • top3_time: top 3 execution durations
    • top3_count: top 3 occurrence times
    • top3_avg_time: top 3 average execution durations

    advice_concurrency

    Integer

    Definition

    Recommended maximum concurrency.

    Range

    N/A

  • Example normal response
    {
      "statistics": [
        {
          "keyword": "SELECT~FROM~table~WHERE~id",
          "raw_sql_text": "select *from db1",
          "ids": [
            123,
            124,
            125,
            126
          ],
          "count": 4,
          "total_time": 14,
          "avg_time": 3.5,
          "max_time": 5,
          "strategy": "top3_average",
          "advice_concurrency": "5"
        }
      ]
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.