All Products
Search
Document Center

AnalyticDB:DescribeDiagnosisTasks

Last Updated:Aug 28, 2026

Queries the execution information about distributed tasks in a stage of a query.

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

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 IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

am-bp1r053byu48p****

RegionId

string

No

The region ID of the cluster.

Note

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

ProcessId

string

Yes

The query ID.

Note

You can call the DescribeProcessList operation to query the IDs of queries that are being executed.

202011191048151921681492420315100****

StageId

string

Yes

The ID of a stage in the query that is specified by the ProcessId parameter.

Stage[26]

Order

string

No

The order in which to sort the tasks by field. Specify the value in the JSON format. Example: [{"Field":"CreateTime", "Type":"desc"}].

Note
  • Field specifies the field that is used to sort the tasks. Valid values of Field: State, CreateTime, DBName, ProcessID, UpdateTime, JobName, and ProcessRows.

  • Type specifies the sort order. Valid values of Type: Desc and Asc. The values are case-insensitive.

[{"Field":"StartTime", "Type": "desc" }]

PageNumber

integer

No

The page number.

1

PageSize

integer

No

The number of entries per page. Valid values:

  • 30 (default)

  • 50

  • 100

30

State

string

No

The state of the asynchronous import or export task to be queried. Valid values:

  • RUNNING

  • FINISHED

  • FAILED

Valid values:

  • FAILED :

    FAILED

  • RUNNING :

    RUNNING

  • FINISHED :

    FINISHED

RUNNING

Host

string

No

The IP address from which the query was initiated.

192.168.XX.XX

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

F0983B43-B2EC-536A-8791-142B5CF1E9B6

TaskList

array<object>

The queried tasks.

object

The queried task.

ScanCost

integer

The amount of time that is consumed to scan data from a data source in the task. Unit: milliseconds.

0

OutputDataSize

integer

The amount of output data in the task. Unit: bytes.

123

InputDataSize

integer

The amount of input data in the task. Unit: bytes.

123

State

string

The final execution state of the task. Valid values:

  • FINISHED

  • CANCELED

  • ABORTED

  • FAILED

FINISHED

OperatorCost

integer

The total amount of time that is consumed by all operators in the task on a node. This parameter can be used to determine whether long tails occur in computing. Unit: milliseconds.

3

OutputRows

integer

The number of output rows in the task.

105

ScanDataSize

integer

The amount of scanned data in the task. Unit: bytes.

123

ElapsedTime

integer

The amount of time that elapsed from when the task was created to when the task was completed. Unit: milliseconds.

456

ScanRows

integer

The number of rows that are scanned from a data source in the task.

0

PeakMemory

integer

The peak memory of the task. Unit: bytes.

234

TaskId

string

The task ID.

22568****

InputRows

integer

The number of input rows in the task.

105

TaskCreateTime

integer

The timestamp when the task was created.

2022-12-12 00:00:12

TaskEndTime

integer

The timestamp when the task ends.

2022-12-22 00:00:00

TaskHost

string

The IP address of the host where the task was executed.

192.168.XX.XX

Drivers

string

The number of tasks that can be executed concurrently.

16

QueuedTime

string

The queuing duration of the task. Unit: milliseconds.

12

ComputeTimeRatio

string

The compute time ratio, which can be used to determine whether the task is really time-consuming. This parameter can be calculated by using the following formula: OperatorCost/Drivers/ElapsedTime. A greater value indicates that the task was executed for computing for most of the task time. A less value indicates that the task was waiting for scheduling or blocked due to other reasons for most of the task time.

0.89

TotalCount

integer

The total number of tasks in the stage.

33

Examples

Success response

JSON format

{
  "RequestId": "F0983B43-B2EC-536A-8791-142B5CF1E9B6",
  "TaskList": [
    {
      "ScanCost": 0,
      "OutputDataSize": 123,
      "InputDataSize": 123,
      "State": "FINISHED",
      "OperatorCost": 3,
      "OutputRows": 105,
      "ScanDataSize": 123,
      "ElapsedTime": 456,
      "ScanRows": 0,
      "PeakMemory": 234,
      "TaskId": "22568****",
      "InputRows": 105,
      "TaskCreateTime": 0,
      "TaskEndTime": 0,
      "TaskHost": "192.168.XX.XX",
      "Drivers": "16",
      "QueuedTime": "12",
      "ComputeTimeRatio": "0.89"
    }
  ],
  "TotalCount": 33
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.