Queries the trend of slow SQL queries of an ApsaraDB for ClickHouse cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeSlowLogTrend

The operation that you want to perform. Set the value to DescribeSlowLogTrend.

RegionId String Yes cn-hangzhou

The region ID of the cluster. You can call the DescribeRegions operation to obtain the region ID.

DBClusterId String Yes cc-bp11xxl475ui8****

The ID of the cluster. You can call the DescribeDBClusters operation to query information about all the clusters that are deployed in a specific region. The returned information includes the ID of each cluster.

StartTime String Yes 2022-05-20 16:00:00

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

EndTime String Yes 2022-05-27 16:00:00

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

Note The end of the time range must be later than the beginning of the time range. The specified time range must be less than seven days.
QueryDurationMs Integer No 1000

The execution duration of slow SQL queries. The minimum value is 1000 and the default value is 1000. Unit: milliseconds. Slow SQL queries that last longer than this duration are returned in response parameters.

Response parameters

Parameter Type Example Description
RequestId String 7D3ECB0E-98CA-5E08-A9CA-F70C5A1E9BDF

The ID of the request.

SlowLogTrend Object

The result set of slow SQL queries.

TableSchema Array of ResultSet

The schema of the table.

ResultSet
Type String UInt64

The type of the column.

Name String query_start_time

The name of the column.

Data Array of ResultSet

Details about slow SQL queries.

ResultSet
QueryStartTime String 2022-05-22 20:00:01

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

MaxQueryDurationMs String 3000

The maximum execution duration. Unit: milliseconds.

MinQueryDurationMs String 1000

The minimum execution duration. Unit: milliseconds.

Count String 4000

The total execution duration of slow SQL queries. Unit: milliseconds.

AvgQueryDurationMs String 2000

The average execution duration. Unit: milliseconds.

Rows String 1

The number of rows in the result set.

RowsBeforeLimitAtLeast String 1

The number of entries returned on each page.

Statistics Object

The statistics of the results.

RowsRead Integer 14721

The total number of rows that were read.

ElapsedTime Float 0.001703578

The time consumed by slow SQL queries. Unit: milliseconds.

BytesRead Integer 697899

The total size of data that were read. Unit: bytes.

Examples

Sample requests

http(s)://clickhouse.aliyuncs.com/?Action=DescribeSlowLogTrend
&RegionId=cn-hangzhou
&DBClusterId=cc-bp11xxl475ui8****
&StartTime=2022-05-20 16:00:00
&EndTime=2022-05-27 16:00:00
&QueryDurationMs=1000
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeSlowLogTrendResponse>
    <RequestId>7D3ECB0E-98CA-5E08-A9CA-F70C5A1E9BDF</RequestId>
    <SlowLogTrend>
        <TableSchema>
            <Type>UInt64</Type>
            <Name>query_start_time</Name>
        </TableSchema>
        <Data>
            <QueryStartTime>2022-05-22 20:00:01</QueryStartTime>
            <MaxQueryDurationMs>3000</MaxQueryDurationMs>
            <MinQueryDurationMs>1000</MinQueryDurationMs>
            <Count>4000</Count>
            <AvgQueryDurationMs>2000</AvgQueryDurationMs>
        </Data>
        <Rows>1</Rows>
        <RowsBeforeLimitAtLeast>1</RowsBeforeLimitAtLeast>
        <Statistics>
            <RowsRead>14721</RowsRead>
            <ElapsedTime>0.001703578</ElapsedTime>
            <BytesRead>697899</BytesRead>
        </Statistics>
    </SlowLogTrend>
</DescribeSlowLogTrendResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "7D3ECB0E-98CA-5E08-A9CA-F70C5A1E9BDF",
  "SlowLogTrend" : {
    "TableSchema" : [ {
      "Type" : "UInt64",
      "Name" : "query_start_time"
    } ],
    "Data" : [ {
      "QueryStartTime" : "2022-05-22 20:00:01",
      "MaxQueryDurationMs" : "3000",
      "MinQueryDurationMs" : "1000",
      "Count" : "4000",
      "AvgQueryDurationMs" : "2000"
    } ],
    "Rows" : "1",
    "RowsBeforeLimitAtLeast" : "1",
    "Statistics" : {
      "RowsRead" : 14721,
      "ElapsedTime" : 0.001703578,
      "BytesRead" : 697899
    }
  }
}

Error codes

HttpCode Error code Error message Description
500 InternalError An error occurred while processing your request. The error message returned because an internal error has occurred. Try again later.
503 ServiceUnavailable An error occurred while processing your request. The error message returned because the service is unavailable. Try again later.

For a list of error codes, visit the API Error Center.