Retrieves diagnostic records for SQL statements that match specified conditions in an AnalyticDB for MySQL cluster.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:DescribeDiagnosisRecords |
get |
DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The cluster ID. Note
You can call the DescribeDBClusters operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs. |
am-bp1r053byu48p**** |
| StartTime |
string |
Yes |
The start of the query time range, as a UNIX timestamp in milliseconds. Note
Only data within the last 14 days can be queried. |
1632931200000 |
| EndTime |
string |
Yes |
The end of the query time range, as a UNIX timestamp in milliseconds. Note
|
1633017540000 |
| RegionId |
string |
Yes |
The region ID of the cluster. Note
You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| QueryCondition |
string |
Yes |
The filter condition for SQL statements, which can contain the
|
{"Type":"status","Value":"finished"} |
| Keyword |
string |
No |
The keyword to filter SQL statements. |
select |
| MinPeakMemory |
integer |
No |
The minimum peak memory of the SQL statements. Unit: bytes. |
0 |
| MaxPeakMemory |
integer |
No |
The maximum peak memory of the SQL statements. Unit: bytes. |
89000000 |
| MinScanSize |
integer |
No |
The minimum scan size of the SQL statements. Unit: bytes. |
0 |
| MaxScanSize |
integer |
No |
The maximum scan size of the SQL statements. Unit: bytes. |
104428198 |
| ResourceGroup |
string |
No |
The resource group to which the SQL statements belong. Note
You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried. |
user_default |
| UserName |
string |
No |
The username that executed the SQL statements. Note
You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried. |
test_user |
| Database |
string |
No |
The database on which the SQL statements are executed. Note
You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried. |
adb_demo |
| ClientIp |
string |
No |
The source IP address. Note
You can call the DescribeDiagnosisDimensions operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried. |
59.82.xx.xx |
| Order |
string |
No |
The sort order for the retrieved SQL statements. Specify this value in JSON format. The value is an ordered array that contains the
|
[{"Field":"StartTime", "Type": "desc" }] |
| PageNumber |
integer |
No |
The page number. Pages start from page 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Valid values: 30, 50, and 100. Default value: 30. |
30 |
| Lang |
string |
No |
The language of file titles and error messages. Valid values:
|
zh |
| PatternId |
string |
No |
The SQL pattern ID. Note
You can call the DescribeSQLPatterns operation to query the information about all SQL patterns within an AnalyticDB for MySQL cluster in a time range, including SQL pattern IDs. |
5575924945138****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| PageNumber |
integer |
The page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
30 |
| TotalCount |
integer |
The total number of entries returned. |
1 |
| Querys |
array<object> |
The queried SQL statements. |
|
|
array<object> |
The queried SQL statement. |
||
| SQL |
string |
The SQL statement. Note
For performance reasons, SQL statements exceeding 5,120 characters are truncated. You can call the DownloadDiagnosisRecords operation to download the diagnostic information about SQL statements that match specified conditions in an AnalyticDB for MySQL cluster, including the complete SQL statements. |
SELECT count(*)\nFROM nation |
| SQLTruncatedThreshold |
integer |
The maximum length of the SQL statement. The value 5120 is returned. Unit: characters. Statements exceeding this limit are truncated. |
5120 |
| Status |
string |
The state of the SQL statement. Valid values:
|
finished |
| OutputDataSize |
integer |
The size of returned data. Unit: bytes. |
9 |
| Cost |
integer |
The total execution duration. Unit: milliseconds. Note
This value is the cumulative value of the |
10 |
| OutputRows |
integer |
The number of rows returned. |
1 |
| RcHost |
string |
The IP address and port number of the AnalyticDB for MySQL frontend node that executed the SQL statement. |
10.0.xx.xx:3004 |
| ScanSize |
integer |
The amount of scanned data. Unit: bytes. |
9 |
| ProcessId |
string |
The query ID. |
2021093000414401000000023503151****** |
| StartTime |
integer |
The execution start time of the SQL statement, as a UNIX timestamp in milliseconds. |
1632933704000 |
| SQLTruncated |
boolean |
Indicates whether the SQL statement is truncated. Valid values:
|
false |
| Database |
string |
The name of the database on which the SQL statement is executed. |
adb_demo |
| ScanRows |
integer |
The number of entries scanned. |
1 |
| ResourceCostRank |
integer |
The execution duration rank of operators used in the SQL statement. Note
This field is returned only for SQL statements that have the |
1 |
| ClientIp |
string |
The source IP address. |
59.82.xx.xx |
| PeakMemory |
integer |
The peak memory. Unit: bytes. |
16648 |
| QueueTime |
integer |
The queuing duration. Unit: milliseconds. |
0 |
| ResourceGroup |
string |
The resource group to which the SQL statement belongs. |
user_default |
| UserName |
string |
The username that executed the SQL statement. |
test_user |
| ExecutionTime |
integer |
The execution duration. Unit: milliseconds. |
6 |
| TotalPlanningTime |
integer |
The time spent generating the execution plan. Unit: milliseconds. |
4 |
| EtlWriteRows |
integer |
The number of rows written by an extract-transform-load (ETL) task. |
0 |
| TotalStages |
integer |
The total number of stages generated. |
2 |
| QueryProperties |
array<object> |
The query properties. |
|
|
object |
The query property. |
||
| Name |
string |
The name of the query property. |
ff |
| Value |
string |
The value of the query property. |
40 |
| PatternId |
string |
The SQL pattern ID. Note
You can call the DescribePatternPerformance operation to query the performance metrics of an SQL pattern within a time range. |
-5575924945138****** |
| RequestId |
string |
The request ID. |
109462AF-B5FA-3D5A-9377-B27E5B****** |
Examples
Success response
JSON format
{
"PageNumber": 1,
"PageSize": 30,
"TotalCount": 1,
"Querys": [
{
"SQL": "SELECT count(*)\\nFROM nation",
"SQLTruncatedThreshold": 5120,
"Status": "finished",
"OutputDataSize": 9,
"Cost": 10,
"OutputRows": 1,
"RcHost": "10.0.xx.xx:3004",
"ScanSize": 9,
"ProcessId": "2021093000414401000000023503151******",
"StartTime": 1632933704000,
"SQLTruncated": false,
"Database": "adb_demo",
"ScanRows": 1,
"ResourceCostRank": 1,
"ClientIp": "59.82.xx.xx",
"PeakMemory": 16648,
"QueueTime": 0,
"ResourceGroup": "user_default",
"UserName": "test_user",
"ExecutionTime": 6,
"TotalPlanningTime": 4,
"EtlWriteRows": 0,
"TotalStages": 2,
"QueryProperties": [
{
"Name": "ff",
"Value": "40"
}
],
"PatternId": "-5575924945138******"
}
],
"RequestId": "109462AF-B5FA-3D5A-9377-B27E5B******"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.