Queries the deduplicated statistics of SQL statements in an AnalyticDB for MySQL cluster. The statistics of an SQL statement include the resource group, database name, username, and source IP address that are associated with the SQL statement.

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 DescribeDiagnosisDimensions

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

DBClusterId String Yes am-bt6u59zcmd945****

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query the details of all AnalyticDB for MySQL clusters within a specific region, including cluster IDs.
StartTime String Yes 1625220210000

The beginning of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds.

Note Only data within the last 14 days can be queried. If you call this operation to query data that is older than 14 days, an empty string is returned.
EndTime String Yes 1625220213000

The end of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds.

Note
  • The end time must be later than the start time.
  • The interval between the start time and the end time cannot exceed 24 hours.
RegionId String No cn-hangzhou

The region ID of the cluster.

Note You can call the DescribeRegions operation to query the regions and zones supported by AnalyticDB for MySQL, including region IDs.
QueryCondition String Yes null

The query conditions for SQL statements, which can be a combination of the Type and Value fields or a combination of the Type, Min, and Max fields. Specify the conditions in the JSON format. Type specifies the query dimension. Valid values for Type: maxCost, status, and cost. Value, Min, or Max specifies the query range for the dimension. Sample values:

  • {"Type":"maxCost","Value":"100"}: queries the top 100 most time-consuming SQL statements. Set Value to 100.
  • {"Type":"status","Value":"finished"}: queries executed SQL statements. You can set Value to running to query SQL statements that are being executed. You can also set Value to failed to query SQL statements that failed to be executed.
  • {"Type":"cost","Min":"10","Max":"200"}: queries SQL statements whose execution durations are between 10 milliseconds and 200 milliseconds. You can also customize the maximum and minimum execution durations.
Lang String No zh

The language of file titles and error messages. Default value: zh. Valid values:

  • zh: simplified Chinese
  • en: English
  • ja: Japanese
  • zh-tw: traditional Chinese

Response parameters

Parameter Type Example Description
ClientIps Array of String ["106.11.xx.xx","106.11.xx.xx"]

The source IP addresses.

ResourceGroups Array of String ["user_defaul"]

The names of resource groups.

UserNames Array of String ["tset_use"]

The usernames.

Databases Array of String ["tpch_1g"]

The names of databases.

RequestId String E0B56BCD-1BED-30EC-8CAF-1D1E5F******

The ID of the request.

Examples

Sample requests

http(s)://adb.aliyuncs.com/?Action=DescribeDiagnosisDimensions
&DBClusterId=am-bt6u59zcmd945****
&StartTime=1625220210000
&EndTime=1625220213000
&RegionId=cn-hangzhou
&QueryCondition={"Type":"maxCost","Value":"100"}
&Lang=zh
&<Common request parameters>

Sample success responses

XML format

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

<DescribeDiagnosisDimensionsResponse>
    <ClientIps>106.11.xx.xx,106.11.xx.xx</ClientIps>
    <ResourceGroups>user_defaul</ResourceGroups>
    <UserNames>tset_use</UserNames>
    <Databases>tpch_1g</Databases>
    <RequestId>E0B56BCD-1BED-30EC-8CAF-1D1E5F******</RequestId>
</DescribeDiagnosisDimensionsResponse>

JSON format

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

{
  "ClientIps" : [ "106.11.xx.xx,106.11.xx.xx" ],
  "ResourceGroups" : [ "user_defaul" ],
  "UserNames" : [ "tset_use" ],
  "Databases" : [ "tpch_1g" ],
  "RequestId" : "E0B56BCD-1BED-30EC-8CAF-1D1E5F******"
}

Error codes

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