DescribePatternPerformance

Updated at:
Copy as MD

Queries the details of various metrics, such as query time and average memory consumption, for SQL patterns in a cluster within a specified time period.

Operation description

For the endpoint of the current service, refer to Endpoints.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

adb:DescribePatternPerformance

list

*All Resource

*

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 details of all clusters in the specified region, including the cluster IDs.

amv-uf6li1r3do8m****

StartTime

string

No

The start time of the query. The time is in UTC and follows the yyyy-MM-ddTHH:mm:ssZ format.

Note
  • If the current date is August 22, 2022 (UTC+8), the earliest data you can query is from August 9, 2022 (UTC+8), which corresponds to 2022-08-08T16:00:00Z in UTC. If the specified start time is earlier than August 9, 2022 (UTC+8) or 2022-08-08T16:00:00Z in UTC, an empty response is returned.

  • The interval between the start time and the end time of the query cannot exceed 24 hours.

2022-08-21T02:15:00Z

EndTime

string

No

The end time of the query. The time is in UTC and follows the yyyy-MM-ddTHH:mmZ format.

Note

The end time must be later than the start time.

2022-08-22T01:06:00Z

RegionId

string

Yes

The region ID.

cn-hangzhou

PatternId

string

No

The ID of the SQL pattern.

Note

You can call the DescribeSQLPatterns operation to query the list of all SQL patterns in the specified cluster within a specified time period, including the SQL pattern IDs.

3847585356974******

Response elements

Element

Type

Description

Example

object

EndTime

string

The end time of the query. The time is in UTC and follows the yyyy-MM-ddTHH:mmZ format.

2022-08-22T01:06:00Z

RequestId

string

The request ID.

F21AF487-B8C9-57E0-8E3A-A92BC3611FB6

StartTime

string

The start time of the query. The time is in UTC and follows the yyyy-MM-ddTHH:mmZ format.

2022-08-21T02:15:00Z

Performances

array<object>

The performance details.

array<object>

The list of performance metrics.

Key

string

The queried performance metrics. Valid values:

  • AnalyticDB_PatternQueryCount: the total number of queries related to the pattern.

  • AnalyticDB_PatternQueryTime: the total time consumed by queries related to the pattern.

  • AnalyticDB_PatternExecutionTime: the execution duration of queries related to the pattern.

  • AnalyticDB_PatternPeakMemory: the peak memory consumed by queries related to the pattern.

  • AnalyticDB_PatternScanSize: the data volume read by queries related to the pattern.

AnalyticDB_PatternExecutionTime

Unit

string

The units corresponding to the performance metrics. Valid values:

  • ms: returned when the performance metric is related to query time, which means the Key value is AnalyticDB_PatternQueryTime or AnalyticDB_PatternExecutionTime.

  • MB: returned when the performance metric is related to peak memory, which means the Key value is AnalyticDB_PatternPeakMemory.

  • MB: returned when the performance metric is the data volume read, which means the Key value is AnalyticDB_PatternScanSize.

  • Empty: returned when the performance metric is the number of queries, which means the Key value is AnalyticDB_PatternQueryCount.

ms

Series

array<object>

The details of each performance value under the performance metrics.

object

The list item.

Values

array

The list of performance values.

string

The detailed information of the performance value at different points in time.

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

Name

string

The name of the performance value. Valid values:

  • When the Key value is AnalyticDB_PatternQueryCount, this parameter returns pattern_query_count, which indicates the executions of SQL statements related to the current pattern.

  • When the Key value is AnalyticDB_PatternQueryTime, this parameter returns:
    • average_query_time: the average total time consumed by SQL statements related to the current pattern.

    • max_query_time: the maximum total time consumed by SQL statements related to the current pattern.

  • When the Key value is AnalyticDB_PatternExecutionTime, this parameter returns:
    • average_execution_time: the average execution duration of SQL statements related to the current pattern.

    • max_execution_time: the maximum execution duration of SQL statements related to the current pattern.

  • When the Key value is AnalyticDB_PatternPeakMemory, this parameter returns:
    • average_peak_memory: the average peak memory consumed by SQL statements related to the current pattern.

    • max_peak_memory: the maximum peak memory consumed by SQL statements related to the current pattern.

  • When the Key value is AnalyticDB_PatternScanSize, this parameter returns:
    • average_scan_size: the average data volume read by SQL statements related to the current pattern.

    • max_scan_size: the maximum data volume read by SQL statements related to the current pattern.

max_query_time

User

string

The database account that executes the SQL statement.

test_user

AccessIp

string

The IP address of the client that submits the SQL statements related to the pattern.

172.16.14.*

SQLPattern

string

The specific statement of the SQL pattern.

SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?

Tables

string

The information about the tables involved in the SQL pattern query.

tpch_1g.part;tpch_1g.supplier;tpch_1g.lineitem;tpch_1g.partsupp;tpch_1g.orders;tpch_1g.nation

FailedCount

integer

The number of failures of the pattern within the query time range.

1

QueryCount

integer

The number of executions of the pattern within the query time range.

1202

Examples

Success response

JSON format

{
  "EndTime": "2022-08-22T01:06:00Z",
  "RequestId": "F21AF487-B8C9-57E0-8E3A-A92BC3611FB6",
  "StartTime": "2022-08-21T02:15:00Z",
  "Performances": [
    {
      "Key": "AnalyticDB_PatternExecutionTime",
      "Unit": "ms",
      "Series": [
        {
          "Values": [
            "[               \"2021-11-18 13:38:00\",               \"224\"             ]"
          ],
          "Name": "max_query_time"
        }
      ]
    }
  ],
  "User": "test_user",
  "AccessIp": "172.16.14.*",
  "SQLPattern": "SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?",
  "Tables": "tpch_1g.part;tpch_1g.supplier;tpch_1g.lineitem;tpch_1g.partsupp;tpch_1g.orders;tpch_1g.nation",
  "FailedCount": 1,
  "QueryCount": 1202
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.