All Products
Search
Document Center

AnalyticDB:DescribePatternPerformance

Last Updated:Aug 30, 2024

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
adb:DescribePatternPerformanceget
  • DBCluster
    acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

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

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 within 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 maximum time range that can be specified is 24 hours.

2021-11-18T00:00:00Z
EndTimestringYes

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.
2021-11-18T18:05:00Z
RegionIdstringYes

The region ID of the cluster.

Note You can call the DescribeRegions operation to query the most recent region list.
cn-hangzhou
PatternIdstringYes

The SQL pattern ID.

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

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

EndTimestring

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.

2021-11-18T18:05Z
RequestIdstring

The request ID.

210f47011634026610213529******
StartTimestring

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.

2021-11-18T00:00Z
Performancesarray<object>

The queried performance metrics.

object

The information about the array object.

Keystring

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.
AnalyticDB_PatternQueryCount
Unitstring

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.
ms
Seriesarray<object>

The queried performance metrics.

object

The information about the array object.

Valuesarray

The queried performance metrics.

string

The value of the performance metric.

[ "2021-11-18 13:38:00", "224" ]
Namestring

The name of the performance metric value. Valid values:

  • When the Key parameter is set to 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 parameter is set to 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 parameter is set to 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 parameter is set to 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 parameter is set 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.
max_query_time

Examples

Sample success responses

JSONformat

{
  "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 Service error codes.

Change history

Change timeSummary of changesOperation
2021-10-12The internal configuration of the API is changed, but the call is not affectedView Change Details
2021-09-27The response structure of the API has changedView Change Details