All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsTrendGroupOutputTps

Last Updated:Mar 03, 2024

Queries the statistics about messages that are consumed by a consumer group within a specific period of time.

Operation description

Note API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.

You can call this operation to query the following statistics that are collected in a production environment:

  • The number of messages that are consumed during each sampling period
  • The transactions per second (TPS) for message consumption during each sampling period

If your application consumes a small number of messages and does not consume messages at specific intervals, we recommend that you query the number of messages that are consumed during each sampling period because the statistics of TPS may not show a clear change trend.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mq:QueryTrendGroupOutputTpsRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
GroupIdstringYes

The ID of the consumer group that you want to query.

GID_test
TopicstringYes

The name of the topic that you want to query.

test
BeginTimelongYes

The timestamp that indicates the beginning of the time range to query. Unit: milliseconds.

1570852800000
EndTimelongYes

The timestamp that indicates the end of the time range to query. Unit: milliseconds.

1570868400000
TypeintegerYes

The type of information that you want to query. Valid values:

  • 0: the number of messages that are consumed during each sampling period.
  • 1: the TPS for message consumption during each sampling period.
0
InstanceIdstringYes

The ID of the instance to which the consumer group you want to query belongs.

MQ_INST_111111111111_DOxxxxxx
PeriodlongNo

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

10

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

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

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

The data returned.

Recordsobject []

The data set returned based on sampling period.

Yfloat

The Y axis. This parameter indicates the TPS for message consumption or the number of messages that are consumed.

0
Xlong

The X axis. The value of this parameter is a UNIX timestamp in milliseconds.

1570867800000
XUnitstring

The unit of the timestamp.

time
YUnitstring

The total number of messages.

msg
Titlestring

The name of the table.

MQ_INST\_111111111111\_DOxxxxxx%test@MQ_INST\_111111111111\_DOxxxxxx%GID_test trend chart of delivered messages

Examples

Sample success responses

JSONformat

{
  "RequestId": "CE57AEDC-8FD2-43ED-8E3B-1F878077****",
  "Data": {
    "Records": {
      "StatsDataDo": [
        {
          "Y": 0,
          "X": 1570867800000
        }
      ]
    },
    "XUnit": "time",
    "YUnit": "msg",
    "Title": "MQ_INST\\_111111111111\\_DOxxxxxx%test@MQ_INST\\_111111111111\\_DOxxxxxx%GID_test trend chart of delivered messages\n"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history

View the statistics about message consumption in the console

You can also view the statistics about message consumption by consumers in a consumer group in the ApsaraMQ for RocketMQ console.**** For more information, see Dashboard .