All Products
Search
Document Center

ApsaraDB for ClickHouse:DescribeSlowLogTrend

Last Updated:Mar 10, 2025

Queries the trend of slow query logs.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
clickhouse:DescribeSlowLogTrendnone
*EnterpriseDBCluster
acs:clickhouse:{#regionId}:{#accountId}:enterprisedbcluster/{#DBInstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The region ID.

cn-hangzhou
DBInstanceIdstringYes

The cluster ID.

cc-bp100p4q1g9z3****
StartTimestringNo

The start of the time range to query. Specify the time in the yyyy-MM-dd hh:mm:ss format. The time must be in UTC.

2023-04-13 17:48:00
EndTimestringNo

The end of the time range to query. Specify the time in the yyyy-MM-dd hh:mm:ss format. The time must be in UTC.

2023-06-07 10:03:00
QueryDurationMsstringNo

The execution duration of slow SQL queries. Minimum value: 1000. Unit: milliseconds.

3000
ProductstringNo

The code of the cloud service.

clickhouse

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

7D3ECB0E-98CA-5E08-A9CA-F70C5A1E9BDF
Dataobject

The returned result.

DBInstanceIDinteger

The cluster ID.

cc-bp100p4q1g9z3****
DBInstanceNamestring

The cluster name.

clusterTest
ResultSetarray<object>

The result sets.

ResultSetobject

The result set.

QueryStartTimestring

The beginning of the time range to query. The time is in the yyyy-MM-dd hh:mm:ss format. The time is displayed in UTC.

2023-04-13 17:48:00
MaxQueryDurationMslong

The maximum execution duration of slow SQL queries. Minimum value: 1000. Unit: milliseconds.

3000
Cntlong

The total number of SQL queries within the specified time range.

1
MinQueryDurationMslong

The minimum execution duration of slow SQL queries. Minimum value: 1000. Unit: milliseconds.

1000
AvgQueryDurationMslong

The average execution duration of slow SQL queries. Minimum value: 1000. Unit: milliseconds.

2000

Examples

Sample success responses

JSONformat

{
  "RequestId": "7D3ECB0E-98CA-5E08-A9CA-F70C5A1E9BDF",
  "Data": {
    "DBInstanceID": 0,
    "DBInstanceName": "clusterTest",
    "ResultSet": [
      {
        "QueryStartTime": "2023-04-13 17:48:00",
        "MaxQueryDurationMs": 3000,
        "Cnt": 1,
        "MinQueryDurationMs": 1000,
        "AvgQueryDurationMs": 2000
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-13The internal configuration of the API is changed, but the call is not affectedView Change Details