You can call this operation to query the trend of slow query logs of an AnalyticDB for MySQL 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 No DescribeSlowLogTrend

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

DBClusterId String Yes rm-uf6wjk5xxxxxxxxxx

The ID of the cluster.

EndTime String Yes 2019-06-20T16:00Z

The end of the time range to query. The end time must be later than the start time. The time span between the start time and the end time must be less than seven days.

Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

StartTime String Yes 2019-06-01T16:00Z

The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

DBName String No test_db

The name of the database.

Response parameters

Parameter Type Example Description
DBClusterId String rm-uf6wjk5xxxxxxxxxx

The ID of the cluster.

EndTime String 2019-06-20T16:00Z

The end time of the query. The end time must be later than the start time. The time span between the start time and the end time must be less than seven days.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Items Array of SlowLogTrendItem

Details about the list of slow SQL trend data.

SlowLogTrendItem
Key String AnalyticDB_SlowLogTrend

The slow SQL trend parameter. Set the value to AnalyticDB_SlowLogTrend.

Series Array of SeriesItem

Details about the performance parameter.

SeriesItem
Name String slow_log_trend

The name of the performance parameter.

Values String [ [ "2019-05-06T05:17:46.487Z", 5 ], [ "2019-05-06T05:18:20.784Z", 5 ] ]

The value of the performance parameter, which is in an array format.

Unit String %

This parameter is a reserved field. The unit of the performance data.

RequestId String 1AD222E9-E606-4A42-BF6D-8A4442913CEF

The ID of the request.

StartTime String 2019-06-01T16:00Z

The beginning of the time range. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Examples

Sample requests

http(s)://[Endpoint]/? Action=DescribeSlowLogTrend
&DBClusterId=rm-uf6wjk5xxxxxxxxxx
&EndTime=2019-06-20T16:00Z
&StartTime=2019-06-01T16:00Z
&<Common request parameters>

Sample success responses

XML format

<RequestId>1AD222E9-E606-4A42-BF6D-8A4442913CEF</RequestId>
<EndTime>2019-06-20T16:00Z</EndTime>
<DBClusterId>rm-uf6wjk5xxxxxxxxxx</DBClusterId>
<StartTime>2019-06-01T16:00Z</StartTime>
<Items>
    <SlowLogTrendItem>
        <Unit/>
        <Key>AnalyticDB_SlowLogTrend</Key>
    </SlowLogTrendItem>
    <SlowLogTrendItem>
        <Series>
            <SeriesItem>
                <Values>[ [ "2019-05-06T05:17:46.487Z", 5 ], [ "2019-05-06T05:18:20.784Z", 5 ] ]</Values>
                <Name>slow_log_trend</Name>
            </SeriesItem>
        </Series>
    </SlowLogTrendItem>
</Items>

JSON format

{
    "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
    "EndTime": "2019-06-20T16:00Z",
    "DBClusterId": "rm-uf6wjk5xxxxxxxxxx",
    "StartTime": "2019-06-01T16:00Z",
    "Items": {
        "SlowLogTrendItem": [
            {
                "Unit": "",
                "Key": "AnalyticDB_SlowLogTrend"
            },
            {
                "Series": {
                    "SeriesItem": {
                        "Values": "[ [ \"2019-05-06T05:17:46.487Z\", 5 ], [ \"2019-05-06T05:18:20.784Z\", 5 ] ]",
                        "Name": "slow_log_trend"
                    }
                }
            }
        ]
    }
}

Error codes

HttpCode Error code Error message Description
404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The error message returned because the specified cluster ID does not exist. Check whether you specify the cluster ID value correctly.

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