Queries the deduplicated statistics of SQL queries that meet specific search conditions in an AnalyticDB for MySQL cluster. These statistics include the resource group, database name, username, and source IP address.

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-****************

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query the detailed information 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 You can view only data from the last 14 days.
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 {"Type":"maxCost","Value":"100"}

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

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

The languages available for file titles and some 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.***.***

The source IP addresses.

ResourceGroups Array of String user_default

The names of the resource groups.

UserNames Array of String test_user

The usernames.

Databases Array of String adb_demo

The names of the 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-****************
&StartTime=1625220210000
&EndTime=1625220213000
&QueryCondition={"Type":"maxCost","Value":"100"}
&<Common request parameters>

Sample success responses

XML format

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

<DescribeDiagnosisDimensionsResponse>
    <RequestId>E0B56BCD-1BED-30EC-8CAF-1D1E5F******</RequestId>
    <ClientIps>106.11.***.***</ClientIps>
    <ClientIps>106.11.***.***</ClientIps>
    <Databases>adb_demo</Databases>
    <ResourceGroups>user_default</ResourceGroups>
    <UserNames>test_user</UserNames>
</DescribeDiagnosisDimensionsResponse>

JSON format

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

{
  "RequestId" : "E0B56BCD-1BED-30EC-8CAF-1D1E5F******",
  "ClientIps" : [ "106.11.***.***", "106.11.***.***" ],
  "Databases" : [ "adb_demo" ],
  "ResourceGroups" : [ "user_default" ],
  "UserNames" : [ "test_user" ]
}

Error codes

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