DescribeWorkerDetection

Updated at:
Copy as MD

Queries the diagnostics results of the storage layer.

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:DescribeWorkerDetection

get

DBCluster

acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}

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 AnalyticDB for MySQL clusters in a specific region, including the cluster ID.

am-xxxxx

RegionId

string

Yes

The region ID.

Note

You can call the DescribeRegions operation to query region IDs.

cn-beijing

StartTime

string

No

The start time of the query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2021-11-18T00:00Z

EndTime

string

No

The end time of the query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2024-04-25T02:04Z

Lang

string

No

The display language of the suggestions. Valid values:

  • zh: Simplified Chinese (default).

  • en: English.

zh

Response elements

Element

Type

Description

Example

object

TotalCount

string

The total number of records.

20

RequestId

string

The request ID.

E5B37B61-E6C9-5FE0-9374-45BAA548AEF6

DBClusterId

string

The cluster ID.

am-xxxxx

DetectionItems

array<object>

The list of detection items and detection results.

array<object>

The detection result.

Name

string

The name of the detection item.

Metric detection

Results

object

The detection result.

SkewedTables

array<object>

The table skew detection.

object

SchemaName

string

The name of the database.

platfunc

TableName

string

The name of the table.

sls_log_cheat_action

DDL

string

The table creation statement.

create table test(id varchar)

PartitionCount

integer

The number of partitions.

2

TotalDataSize

integer

The total data size of the table. Unit: bytes.

2345

TotalRowCount

integer

The total number of rows in the table.

34

TotalPkSize

integer

The data size of the primary key in the table. Unit: bytes.

234

TotalRemoteDataSize

integer

The size of cold data. Unit: bytes.

234

TotalLocalDataSize

string

The size of local data. Unit: bytes.

2345

ShardSkewedRows

string

The number of skewed rows in the table.

1234

PartitionedTables

array<object>

The list of tables with improper partitions.

object

The table with improper partitions.

SchemaName

string

The name of the database.

nxg

TableName

string

The name of the table.

zhw_place_order

DDL

string

The table creation statement.

create table test(id varchar)

PartitionCount

string

The number of partitions.

234

PartitionIds

string

The IDs of the improper partitions.

[2024,2025]

TotalDataSize

integer

The total data size of the table.

1234

TopAccessTables

array<object>

The collection of table access detection results.

array<object>

The table access detection result.

MetricName

string

The name of the detection metric.

Peak memory detection

SearchResults

array<object>

The collection of table access search results.

object

The table access search result.

TableName

string

The name of the table.

tiberias_2copt_origin_order_goods_info

MaxScanCost

integer

The maximum scan duration. Unit: milliseconds.

345

AvgScanCost

number

The average scan duration. Unit: milliseconds.

234

MaxScanSize

integer

The maximum amount of data read. Unit: bytes.

2345

AvgScanSize

number

The average amount of data read from the table. Unit: bytes.

234

AccessCount

integer

The number of times the table is accessed.

1111

OperatorDetails

array<object>

The collection of operator detection results.

array<object>

The operator detection result.

MetricName

string

The name of the metric.

PeakMemory

SearchResults

array<object>

The collection of search results.

object

The operator detection result.

ProcessId

string

The SQL query ID returned for diagnostics.

2024041909301402103302422803151411141

StageId

string

The stage ID.

Stage[2]

OperatorName

string

The name of the operator.

TableScan

PeakMemory

integer

The peak memory consumed by the operator. Unit: bytes.

23

OperatorCost

integer

The total operator duration within the stage, which is equivalent to the CPU time of the stage. This metric can be actively used to determine which parts of the query consume the most compute resources. Unit: milliseconds.

23

InputRows

integer

The number of input rows for the operator.

123

OutputRows

integer

The number of output rows for the operator.

123

InputSize

integer

The amount of input data for the operator. Unit: bytes.

123

OutputSize

integer

The amount of output data for the operator. Unit: bytes.

123

OperatorInfo

string

The property information of the operator.

Group By field: id

OperatorAgg

array<object>

The aggregation detection result of operator metrics.

array<object>

MetricName

string

The name of the aggregation detection item for operator metrics.

Peak memory

SearchResults

array<object>

The collection of search results for aggregated operator metrics.

object

OperatorName

string

The name of the operator.

Aggregation

MaxValue

integer

The maximum value of the operator metric.

444

TotalValue

integer

The accumulated value of the operator metric.

123

AvgValue

number

The average value of the operator metric.

2234

OperatorCount

integer

The number of times the operator appears.

1234

Message

string

The detection result message.

There are a total of 10 tables with an excessive number of primary keys.

Status

string

The status of the detection result. Valid values:

  • NORMAL

  • WARNING

  • CRITICAL

WARNING

Examples

Success response

JSON format

{
  "TotalCount": "20",
  "RequestId": "E5B37B61-E6C9-5FE0-9374-45BAA548AEF6",
  "DBClusterId": "am-xxxxx",
  "DetectionItems": [
    {
      "Name": "指标检测",
      "Results": {
        "SkewedTables": [
          {
            "SchemaName": "platfunc",
            "TableName": "sls_log_cheat_action",
            "DDL": "create table test(id varchar)",
            "PartitionCount": 2,
            "TotalDataSize": 2345,
            "TotalRowCount": 34,
            "TotalPkSize": 234,
            "TotalRemoteDataSize": 234,
            "TotalLocalDataSize": "2345",
            "ShardSkewedRows": "1234"
          }
        ],
        "PartitionedTables": [
          {
            "SchemaName": "nxg",
            "TableName": "zhw_place_order",
            "DDL": "create table test(id varchar)",
            "PartitionCount": "234",
            "PartitionIds": "[2024,2025]",
            "TotalDataSize": 1234
          }
        ],
        "TopAccessTables": [
          {
            "MetricName": "峰值内存检测",
            "SearchResults": [
              {
                "TableName": "tiberias_2copt_origin_order_goods_info",
                "MaxScanCost": 345,
                "AvgScanCost": 234,
                "MaxScanSize": 2345,
                "AvgScanSize": 234,
                "AccessCount": 1111
              }
            ]
          }
        ],
        "OperatorDetails": [
          {
            "MetricName": "PeakMemory",
            "SearchResults": [
              {
                "ProcessId": "2024041909301402103302422803151411141",
                "StageId": "Stage[2]",
                "OperatorName": "TableScan",
                "PeakMemory": 23,
                "OperatorCost": 23,
                "InputRows": 123,
                "OutputRows": 123,
                "InputSize": 123,
                "OutputSize": 123,
                "OperatorInfo": "Group By字段:id"
              }
            ]
          }
        ],
        "OperatorAgg": [
          {
            "MetricName": "峰值内存",
            "SearchResults": [
              {
                "OperatorName": "Aggregation",
                "MaxValue": 444,
                "TotalValue": 123,
                "AvgValue": 2234,
                "OperatorCount": 1234
              }
            ]
          }
        ]
      },
      "Message": "检测到多个表存在主键过多的问题",
      "Status": "WARNING"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The specified DBClusterId parameter does not exist. Make sure that the DBClusterId value is valid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.