DescribePatternPerformance

更新时间:
复制 MD 格式

View metric details (such as query time and average memory consumption) for SQL patterns over a specified time range in a cluster.

Operation description

For the endpoint of this service, see endpoint.

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 a region, including their cluster IDs.

amv-uf6li1r3do8m****

StartTime

string

No

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

Note
  • You can query data from the last 14 days. If you specify a start time earlier than this period, an empty value is returned. For example, if the current date is August 22, 2022 (China Standard Time), the earliest valid start time is 2022-08-08T16:00:00Z.

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

2022-08-21T02:15:00Z

EndTime

string

No

The end of the time range to query. Specify the time in UTC in the yyyy-MM-ddTHH:mm:ssZ 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 information about all SQL patterns in a cluster within a specified time range, including the ID of each SQL pattern.

3847585356974******

Response elements

Element

Type

Description

Example

object

EndTime

string

The end of the query time range. The time is in UTC and is formatted as yyyy-MM-ddTHH:mmZ.

2022-08-22T01:06:00Z

RequestId

string

The request ID.

F21AF487-B8C9-57E0-8E3A-A92BC3611FB6

StartTime

string

The start of the query time range. The time is in UTC and is formatted as yyyy-MM-ddTHH:mmZ.

2022-08-21T02:15:00Z

Performances

array<object>

The performance metrics.

array<object>

The details of a performance metric.

Key

string

The performance metric. Valid values:

  • AnalyticDB_PatternQueryCount: The total number of queries that match the sql pattern.

  • AnalyticDB_PatternQueryTime: The total time for queries that match the sql pattern.

  • AnalyticDB_PatternExecutionTime: The total execution time of queries that match the sql pattern.

  • AnalyticDB_PatternPeakMemory: The peak memory usage of queries that match the sql pattern.

  • AnalyticDB_PatternScanSize: The total data scan size of queries that match the sql pattern.

AnalyticDB_PatternExecutionTime

Unit

string

The unit of the performance metric. The returned unit varies based on the value of Key:

  • If Key is AnalyticDB_PatternQueryTime or AnalyticDB_PatternExecutionTime, the unit is ms.

  • If Key is AnalyticDB_PatternPeakMemory, the unit is MB.

  • If Key is AnalyticDB_PatternScanSize, the unit is MB.

  • If Key is AnalyticDB_PatternQueryCount, this parameter is empty.

ms

Series

array<object>

The time series data for the performance metric.

object

A time series for a specific performance value.

Values

array

The list of performance values.

string

A data point, which is an array containing a timestamp and its corresponding performance value.

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

Name

string

The name of the performance value. The value of this parameter varies based on the value of Key:

  • If Key is AnalyticDB_PatternQueryCount, this parameter returns pattern_query_count, which indicates the query count for the sql pattern.

  • If Key is AnalyticDB_PatternQueryTime, this parameter can be one of the following values:
    • average_query_time: the average total time of queries that match the sql pattern.

    • max_query_time: the maximum total time of queries that match the sql pattern.

  • If Key is AnalyticDB_PatternExecutionTime, this parameter can be one of the following values:
    • average_execution_time: the average execution time of queries that match the sql pattern.

    • max_execution_time: the maximum execution time of queries that match the sql pattern.

  • If Key is AnalyticDB_PatternPeakMemory, this parameter can be one of the following values:
    • average_peak_memory: the average peak memory usage of queries that match the sql pattern.

    • max_peak_memory: the maximum peak memory usage of queries that match the sql pattern.

  • If Key is AnalyticDB_PatternScanSize, this parameter can be one of the following values:
    • average_scan_size: the average data scan size of queries that match the sql pattern.

    • max_scan_size: the maximum data scan size of queries that match the sql pattern.

max_query_time

User

string

The database account that executes the SQL statements.

test_user

AccessIp

string

The client IP address that submitted the queries that match the sql pattern.

172.16.14.*

SQLPattern

string

The SQL statement for the sql pattern.

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

Tables

string

The tables queried by the sql pattern.

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

FailedCount

integer

The number of failed executions for the sql pattern within the query time range.

1

QueryCount

integer

The number of executions for the sql 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.