Queries the metrics of an SQL pattern such as the query duration and average memory usage within a specific period of time.

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 DescribePatternPerformance

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

DBClusterId String Yes am-****************

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 2021-11-18T00:00:00Z

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

Note
  • Only data for the last 14 days can be queried. For example, if the current date is November 22 (UTC+8), you can query data on a day as early as November 9 by setting StartTime to 2021-11-08T16:00:00Z. If you set StartTime to a value earlier than 2021-11-08T16:00:00Z, the Performances parameter is empty.
  • The interval between the start time and the end time cannot exceed 24 hours.
EndTime String Yes 2021-11-18T18:05:00Z

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

Note The end time must be later than the start time.
RegionId String Yes cn-hangzhou

The ID of the region.

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

The ID of the SQL pattern.

Note You can call the DescribeSQLPatterns operation to query the information of all SQL patterns in an AnalyticDB for MySQL cluster within a specific period of time, including SQL pattern IDs.

Response parameters

Parameter Type Example Description
EndTime String 2021-11-18T18:05Z

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

RequestId String 210f47011634026610213529******

The ID of the request.

StartTime String 2021-11-18T00:00Z

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

Performances Array of PerformanceItem

The performance metrics.

Key String AnalyticDB_PatternQueryCount

The performance metric that was queried. Valid values:

  • AnalyticDB_PatternQueryCount: the total number of queries executed in association with the SQL pattern.
  • AnalyticDB_PatternQueryTime: the total amount of time consumed by the queries executed in association with the SQL pattern.
  • AnalyticDB_PatternExecutionTime: the total execution duration of the queries executed in association with the SQL pattern.
  • AnalyticDB_PatternPeakMemory: the peak memory usage of the queries executed in association with the SQL pattern.
  • AnalyticDB_PatternScanSize: the amount of data scanned in the queries executed in association with the SQL pattern.
Unit String ms

The unit of the performance metric. Valid values:

  • When the performance metric is related to the query duration (the Key value is AnalyticDB_PatternQueryTime or AnalyticDB_PatternExecutionTime), ms is returned.
  • When the performance metric is related to the memory usage (the Key value is AnalyticDB_PatternPeakMemory), MB is returned.
  • When the performance metric is related to the amount of data scanned (the Key value is AnalyticDB_PatternScanSize), MB is returned.
  • When the performance metric is related to the number of queries (the Key value is AnalyticDB_PatternQueryCount), this parameter is empty.
Series Array of SeriesItem

Details of the performance metrics.

Values Array of String [ "2021-11-18 13:38:00", "224" ]

The values of the performance metrics.

Name String max_query_time

The name of the performance metric value. Valid values:

  • When the Key value is AnalyticDB_PatternQueryCount, pattern_query_count is returned, which indicates the number of executions of the SQL statements in association with the SQL pattern.
  • When the Key value is AnalyticDB_PatternQueryTime, the following values are returned:
    • average_query_time, which indicates the average total amount of time consumed by the SQL statements in association with the SQL pattern.
    • max_query_time, which indicates the maximum total amount of time consumed by the SQL statements in association with the SQL pattern.
  • When the Key value is AnalyticDB_PatternExecutionTime, the following values are returned:
    • average_execution_time, which indicates the average execution duration of the SQL statements in association with the SQL pattern.
    • max_execution_time, which indicates the maximum execution duration of the SQL statements in association with the SQL pattern.
  • When the Key value is AnalyticDB_PatternPeakMemory, the following values are returned:
    • average_peak_memory, which indicates the average peak memory usage of the SQL statements in association with the SQL pattern.
    • max_peak_memory, which indicates the maximum peak memory usage of the SQL statements in association with the SQL pattern.
  • When the Key value is AnalyticDB_PatternScanSize, the following values are returned:
    • average_scan_size, which indicates the average amount of data scanned by the SQL statements in association with the SQL pattern.
    • max_scan_size, which indicates the maximum amount of data scanned by the SQL statements in association with the SQL pattern.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribePatternPerformance
&DBClusterId=am-****************
&StartTime=2021-11-18T00:00:00Z
&EndTime=2021-11-18T18:05:00Z
&RegionId=cn-hangzhou
&PatternId=3847585356974******
&<Common request parameters>

Sample success responses

XML format

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

<DescribePatternPerformanceResponse>
    <EndTime>2021-11-18T18:05Z</EndTime>
    <RequestId>210f47011634026610213529******</RequestId>
    <StartTime>2021-11-18T00:00Z</StartTime>
    <Performances>
        <Key>AnalyticDB_PatternQueryCount</Key>
        <Unit>ms</Unit>
        <Series>
            <Values>[               "2021-11-18 13:38:00",               "224"             ]</Values>
            <Name>max_query_time</Name>
        </Series>
    </Performances>
</DescribePatternPerformanceResponse>

JSON format

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

{
  "EndTime" : "2021-11-18T18:05Z",
  "RequestId" : "210f47011634026610213529******",
  "StartTime" : "2021-11-18T00:00Z",
  "Performances" : {
    "Key" : "AnalyticDB_PatternQueryCount",
    "Unit" : "ms",
    "Series" : {
      "Values" : "[               \"2021-11-18 13:38:00\",               \"224\"             ]",
      "Name" : "max_query_time"
    }
  }
}

Error codes

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