DescribeSlowLogHistogramAsync

Updated at:

Asynchronously retrieves the slow log trends data of an instance.

Operation description

Before you invoke this operation, make sure that you fully understand the billing methods and pricing of DAS.

Before you begin, ensure that the following prerequisites are met:

  • DAS Enterprise Edition or the intelligent Alibaba Cloud Managed Services (not yet online) is activated for the requested instance.

  • Use the latest version of the Alibaba Cloud SDK or DAS SDK.

  • When you use an SDK to invoke DAS, set the region to cn-shanghai.

This operation is invoked asynchronously and does not immediately return the complete result. If the value of isFinish in the returned data is false, wait 1 second and invoke the operation again until the value of isFinish is true and the complete result is returned.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hdm:DescribeSlowLogHistogramAsync

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The database instance ID.

rm-2ze8g2am97624****

NodeId

string

No

The node ID.

Note

For a PolarDB for MySQL instance, you must specify the node ID.

r-****-db-0

StartTime

integer

Yes

The start time of the query task. Specify a UNIX timestamp in milliseconds.

1596177993000

EndTime

integer

Yes

The end time of the query. Specify a UNIX timestamp in milliseconds.

Note

The end time must be later than the start time.

1662518540764

Filters

array<object>

No

The list of query filter conditions.

object

No

The supported parameters and values for Key:

hostAddress: the source. Separate multiple values with commas.

sqlId: the SQL ID. Separate multiple values with commas.

user: the user. Separate multiple values with commas.

dbName: the database. Separate multiple values with commas.

Key

string

No

The filter parameter.

None

Value

string

No

The value of the filter parameter.

None

Response elements

Element

Type

Description

Example

object

Code

string

The status code.

200

Message

string

The message returned.

Note

If the request is successful, Successful is returned. If the request fails, an error message such as an error code is returned.

Successful

RequestId

string

The request ID.

B6D17591-B48B-4D31-9CD6-9B9796B2****

Success

string

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Data

object

The returned histogram data for slow query log statistics.

RequestKey

string

The key of the request parameter.

None

ResultId

string

The result ID.

async__20ee808e72257f16a4fe024057ca****

State

string

The current state. Valid values:

  • RUNNING: Running.

  • SUCCESS: Successful.

  • FAIL: Failed.

SUCCESS

IsFinish

boolean

Indicates whether the operation is complete.

true

Data

object

The data.

Total

integer

The total number of queried records.

1

Count

array

The trend of the number of slow query logs.

integer

The number of slow query logs.

100

Ts

array

This field is used only for relational databases.

integer

The time when the first event occurred, represented as a UNIX timestamp in milliseconds.

1735098480000

TsEnd

array

Unused. Reserved field.

integer

The end timestamp of the query.

1735098540000

Item

array<object>

The trend metrics.

array<object>

The specific item name.

NodeId

string

The node ID.

r-bp1hi0wg57s3n0i3n8-db-0

Count

array

The number of slow query logs.

integer

The number of slow query logs.

100

InsItems

array<object>

The trend metrics.

Note

Supported only by ApsaraDB for MongoDB instances.

object

The trend metrics.

Note

Supported only by ApsaraDB for MongoDB instances.

InsId

string

The instance role ID.

Note

Supported only by ApsaraDB for MongoDB instances.

2492

InsRole

string

The instance role.

Note

Supported only by ApsaraDB for MongoDB instances.

userAdmin

Count

array

The number of executions.

integer

The number of executions.

1

TotalCount

integer

The number of slow query logs on the physical node.

10

TotalCount

integer

The total number of slow query logs.

20

InsRole

string

The instance role.

Note

Supported only by ApsaraDB for MongoDB instances.

userAdmin

Rt

array

The total execution duration, in seconds.

number

The total execution duration, in seconds.

2.306

AvgRt

array

The average execution duration.

number

The average execution duration.

1.593

MaxRt

array

The maximum execution duration, in seconds.

number

The maximum execution duration, in seconds.

1.593

LockTime

array

The total lock wait time, in seconds.

number

The total lock wait time, in seconds.

1.051

AvgLockTime

array

The average lock wait time, in seconds.

number

The average lock wait time, in seconds.

1.051

MaxLockTime

array

The maximum lock wait time, in seconds.

number

The maximum lock wait time, in seconds.

1.051

RowsExamined

array

The total number of scanned rows.

Note

This field is currently supported by the following databases: ApsaraDB RDS for MySQL, ApsaraDB RDS for PostgreSQL, and PolarDB for MySQL.

integer

The total number of scanned rows.

Note

This field is currently supported by the following databases: ApsaraDB RDS for MySQL, ApsaraDB RDS for PostgreSQL, and PolarDB for MySQL.

256

AvgRowsExamined

array

The average number of scanned rows.

number

The average number of scanned rows.

256.0

MaxRowsExamined

array

The maximum number of scanned rows.

integer

The maximum number of scanned rows.

256

RowsSent

array

The number of returned rows.

integer

The number of returned rows.

384

AvgRowsSent

array

The average number of returned rows.

number

The average number of returned rows.

128.0

MaxRowsSent

array

The maximum number of returned rows.

integer

The maximum number of returned rows.

256

KeysExamined

array

The number of scanned index keys.

Note

Supported only by ApsaraDB for MongoDB instances.

integer

The number of scanned index keys.

Note

Supported only by ApsaraDB for MongoDB instances.

384

AvgKeysExamined

array

The average number of scanned index keys.

Note

Supported only by ApsaraDB for MongoDB instances.

number

The average number of scanned index keys.

Note

Supported only by ApsaraDB for MongoDB instances.

128.0

MaxKeysExamined

array

The maximum number of scanned index keys.

Note

Supported only by ApsaraDB for MongoDB instances.

integer

The maximum number of scanned index keys.

Note

Supported only by ApsaraDB for MongoDB instances.

384

DocExamined

array

The number of scanned documents.

Note

Supported only by ApsaraDB for MongoDB instances.

integer

The number of scanned documents.

Note

Supported only by ApsaraDB for MongoDB instances.

256

AvgDocExamined

array

The average number of scanned documents.

Note

Supported only by ApsaraDB for MongoDB instances.

number

The average number of scanned documents.

Note

Supported only by ApsaraDB for MongoDB instances.

128.0

MaxDocExamined

array

The maximum number of scanned documents.

Note

Supported only by ApsaraDB for MongoDB instances.

integer

The maximum number of scanned documents.

Note

Supported only by ApsaraDB for MongoDB instances.

256

ReturnNum

array

The number of returned rows.

Note

Supported only by ApsaraDB for MongoDB instances.

integer

The number of returned rows.

Note

Supported only by ApsaraDB for MongoDB instances.

256

AvgReturnNum

array

The average number of returned rows.

Note

Supported only by ApsaraDB for MongoDB instances.

number

The average number of returned rows.

Note

Supported only by ApsaraDB for MongoDB instances.

128.0

MaxReturnNum

array

The maximum number of returned rows.

Note

Supported only by ApsaraDB for MongoDB instances.

integer

The maximum number of returned rows.

Note

Supported only by ApsaraDB for MongoDB instances.

256

IOWrites

array

The number of I/O writes.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The number of I/O writes.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

256

AvgIOWrites

array

The average number of I/O writes.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

number

The average number of I/O writes.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

384

MaxIOWrites

array

The maximum number of I/O writes.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The maximum number of I/O writes.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

256

LastRowsCountAffected

array

The number of rows affected by the last statement.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The number of rows affected by the last statement.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

256

AvgLastRowsCountAffected

array

The average number of rows affected by the last statement.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

number

The average number of rows affected by the last statement.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

1.593

MaxLastRowsCountAffected

array

The maximum number of rows affected by the last statement.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The average number of rows affected by the last statement.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

1

LogicalIOReads

array

The number of logical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The number of logical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

384

AvgLogicalIOReads

array

The average number of logical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

number

The average number of logical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

1.593

MaxLogicalIOReads

array

The maximum number of logical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The maximum number of logical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

124

PhysicalIOReads

array

The number of physical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The number of physical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

324

AvgPhysicalIOReads

array

The average number of physical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

number

The average number of physical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

128.0

MaxPhysicalIOReads

array

The maximum number of physical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The maximum number of physical reads.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

314

RowsCountAffected

array

The number of affected rows.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The number of affected rows.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

34

AvgRowsCountAffected

array

The average number of affected rows.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

number

The average number of affected rows.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

1.593

MaxRowsCountAffected

array

The maximum number of affected rows.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

integer

The maximum number of affected rows.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

714

CPUTime

array

The CPU time. Unit: seconds.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

number

The CPU time. Unit: seconds.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

1.051

AvgCPUTime

array

The average CPU time. Unit: seconds.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

number

The average CPU time. Unit: seconds.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

2.306

MaxCPUTime

array

The maximum CPU time. Unit: seconds.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

number

The maximum CPU time. Unit: seconds.

Note

Supported only for ApsaraDB RDS for SQL Server instances.

2.306

Rows

array

The total number of rows updated or returned by the compute nodes of a PolarDB-X 2.0 database instance.

Note

Supported only for ApsaraDB for PolarDB-X 2.0 database instances.

integer

The total number of rows updated or returned by the compute nodes of a PolarDB-X 2.0 database instance.

Note

Supported only for ApsaraDB for PolarDB-X 2.0 database instances.

0

AvgRows

array

The average number of rows.

number

The average number of rows.

0

MaxRows

array

The maximum number of rows.

integer

The maximum number of rows.

0

Frows

array

The number of rows pulled by the compute nodes (CN) of a PolarDB-X 2.0 database.

Note

Supported only for ApsaraDB for PolarDB-X 2.0 database instances.

integer

The number of rows pulled by the compute nodes (CN) of a PolarDB-X 2.0 database.

Note

Supported only for ApsaraDB for PolarDB-X 2.0 database instances.

0

AvgFrows

array

The average number of pulled rows.

number

The average number of pulled rows.

0

MaxFrows

array

The maximum number of pulled rows.

integer

The maximum number of pulled rows.

0

Scnt

array

The number of requests sent to data nodes (DN) by the compute nodes (CN) of a PolarDB-X 2.0 database.

Note

Supported only for ApsaraDB for PolarDB-X 2.0 database instances.

integer

The number of requests sent to data nodes (DN) by the compute nodes (CN) of a PolarDB-X 2.0 database.

Note

Supported only for ApsaraDB for PolarDB-X 2.0 database instances.

0

AvgScnt

array

The average number of requests.

number

The average number of requests.

0

MaxScnt

array

The maximum number of requests.

integer

The maximum number of requests.

0

TotalCount

integer

The total number of slow query logs.

5

ErrorCode

integer

The error code.

10910

Message

string

The error message.

Successful

Timestamp

integer

The request time. The value is a UNIX timestamp in milliseconds.

1645668213000

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "Successful",
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Success": "true",
  "Data": {
    "RequestKey": "None",
    "ResultId": "async__20ee808e72257f16a4fe024057ca****",
    "State": "SUCCESS",
    "IsFinish": true,
    "Data": {
      "Total": 1,
      "Count": [
        100
      ],
      "Ts": [
        0
      ],
      "TsEnd": [
        0
      ],
      "Item": [
        {
          "NodeId": "r-bp1hi0wg57s3n0i3n8-db-0",
          "Count": [
            100
          ],
          "InsItems": [
            {
              "InsId": "2492",
              "InsRole": "userAdmin",
              "Count": [
                1
              ],
              "TotalCount": 10
            }
          ],
          "TotalCount": 20,
          "InsRole": "userAdmin"
        }
      ],
      "Rt": [
        0
      ],
      "AvgRt": [
        0
      ],
      "MaxRt": [
        0
      ],
      "LockTime": [
        0
      ],
      "AvgLockTime": [
        0
      ],
      "MaxLockTime": [
        0
      ],
      "RowsExamined": [
        0
      ],
      "AvgRowsExamined": [
        0
      ],
      "MaxRowsExamined": [
        0
      ],
      "RowsSent": [
        0
      ],
      "AvgRowsSent": [
        0
      ],
      "MaxRowsSent": [
        0
      ],
      "KeysExamined": [
        0
      ],
      "AvgKeysExamined": [
        0
      ],
      "MaxKeysExamined": [
        0
      ],
      "DocExamined": [
        0
      ],
      "AvgDocExamined": [
        0
      ],
      "MaxDocExamined": [
        0
      ],
      "ReturnNum": [
        0
      ],
      "AvgReturnNum": [
        0
      ],
      "MaxReturnNum": [
        0
      ],
      "IOWrites": [
        0
      ],
      "AvgIOWrites": [
        0
      ],
      "MaxIOWrites": [
        0
      ],
      "LastRowsCountAffected": [
        0
      ],
      "AvgLastRowsCountAffected": [
        0
      ],
      "MaxLastRowsCountAffected": [
        0
      ],
      "LogicalIOReads": [
        0
      ],
      "AvgLogicalIOReads": [
        0
      ],
      "MaxLogicalIOReads": [
        0
      ],
      "PhysicalIOReads": [
        0
      ],
      "AvgPhysicalIOReads": [
        0
      ],
      "MaxPhysicalIOReads": [
        0
      ],
      "RowsCountAffected": [
        0
      ],
      "AvgRowsCountAffected": [
        0
      ],
      "MaxRowsCountAffected": [
        0
      ],
      "CPUTime": [
        0
      ],
      "AvgCPUTime": [
        0
      ],
      "MaxCPUTime": [
        0
      ],
      "Rows": [
        0
      ],
      "AvgRows": [
        0
      ],
      "MaxRows": [
        0
      ],
      "Frows": [
        0
      ],
      "AvgFrows": [
        0
      ],
      "MaxFrows": [
        0
      ],
      "Scnt": [
        0
      ],
      "AvgScnt": [
        0
      ],
      "MaxScnt": [
        0
      ],
      "TotalCount": 5
    },
    "ErrorCode": 10910,
    "Message": "Successful",
    "Timestamp": 1645668213000
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The request parameters are invalid. The request parameters are invalid.
403 NoPermission You are not authorized to do this action. You do not have the permission to perform this operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.