All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsTrendGroupOutputTps

Last Updated:Dec 12, 2025

Queries the message consumption statistics for a specified group ID over a period of time.

Operation description

Important Alibaba Cloud OpenAPI is a control plane API used to manage and query resources of Alibaba Cloud services. You can integrate OpenAPI only on the control plane. Do not use OpenAPI for the core data link of message sending and receiving because this can pose a threat to the link.
When you generate consumption data reports in a production environment, you can use this operation to query the following statistics for a specified group ID over a period of time:

  • A statistical curve of the total number of consumed messages

  • A statistical curve of the Transaction Per Second (TPS) for message consumption

If your application has a small and uneven volume of messages, querying by TPS may not return meaningful data. In this case, you can query the total number of consumed messages.

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

mq:QueryTrendGroupOutputTps

get

Group

acs:mq:{#regionId}:{#accountId}:{#GroupName}

Group

acs:mq:{#regionId}:{#accountId}:{#InstanceId}%{#GroupName}

None
  • mq:OnsInstanceBaseInfo

Request parameters

Parameter

Type

Required

Description

Example

GroupId

string

Yes

The ID of the group to query.

GID_test

Topic

string

Yes

The name of the topic to query.

test

BeginTime

integer

Yes

The beginning of the time range to query. This value is a UNIX timestamp in milliseconds.

1570852800000

EndTime

integer

Yes

The end of the time range to query. This value is a UNIX timestamp in milliseconds.

1570868400000

Type

integer

Yes

The type of information to query. Valid values:

  • 0: The statistical curve of the total number of consumed messages.

  • 1: The statistical curve of the TPS for message consumption.

0

InstanceId

string

No

The ID of the instance to which the group belongs.

MQ_INST_111111111111_DOxxxxxx

Period

integer

No

The sampling period. Unit: minutes. Valid values: 1, 5, and 10.

10

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request. This is a common parameter. Each request has a unique ID that you can use to troubleshoot issues.

CE57AEDC-8FD2-43ED-8E3B-1F878077****

Data

object

The returned data.

Records

object

StatsDataDo

array<object>

The data points.

object

Y

number

The y-axis, which indicates the data value. The data can be the TPS or the total number of messages.

0

X

integer

The x-axis, which indicates the timestamp in milliseconds.

1570867800000

XUnit

string

The unit of the x-axis. The time is measured in ms.

ms

YUnit

string

The unit of the y-axis. The value can be the number of consumed messages (msg) or the TPS for message consumption (msg/min).

msg

Title

string

The name of the table.

TopicXXX@GID_XXXReceive Trend Chart

Examples

Success response

JSON format

{
  "RequestId": "CE57AEDC-8FD2-43ED-8E3B-1F878077****",
  "Data": {
    "Records": {
      "StatsDataDo": [
        {
          "Y": 0,
          "X": 1570867800000
        }
      ]
    },
    "XUnit": "ms",
    "YUnit": "msg",
    "Title": "TopicXXX@GID_XXXReceive Trend Chart"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.