Queries the statistics on messages consumed by consumers of a specified group ID within a specified time range.

Usage notes

When the system generates consumption statistics online, you can call this operation to query the following statistics on a specified group ID:

  • the statistical curve of total consumed messages
  • the statistical curve of transactions per second (TPS) for message consumption
Note If the message volume is small and messages are unevenly distributed for your application, the TPS curve may be flat. We recommend that you query the total number of consumed messages.

QPS limit

The queries-per-minute (QPM) limit on this operation is 15 per user. Throttling is triggered when the number of calls to this operation per minute exceeds the QPM limit. Throttling may affect your business. Therefore, call this operation based on your needs. For more information, see QPS limits.

Authorization information

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after they are authorized to use it. The following table lists the authorization information of this operation. For more information, see Policies and examples.

API

Action

Resource with a namespace

Resource without a namespace

OnsTrendGroupOutputTps

mq:QueryTrendGroupOutputTps

acs:mq:*:*:{instanceId}%{groupId}

acs:mq:*:*:{groupId}

Request parameters

Parameter Type Required Example Description
Action String Yes OnsTrendGroupOutputTps

The operation that you want to perform. Set the value to OnsTrendGroupOutputTps.

BeginTime Long Yes 1570852800000

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

EndTime Long Yes 1570868400000

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

GroupId String Yes GID_test

The consumer group ID that you want to query.

InstanceId String Yes MQ_INST_111111111111_DOxxxxxx

The ID of the Message Queue for Apache RocketMQ instance where the consumer group ID is located.

Topic String Yes test

The name of the topic that you want to query.

Type Integer Yes 0

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

  • 0: queries the statistical curve of total consumed messages.
  • 1: queries the statistical curve of TPS for message consumption.
Period Long No 10

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

Response parameters

Parameter Type Example Description
Data Struct

The returned data set.

Records Array of StatsDataDo

The data set that includes more detailed information.

StatsDataDo
X Long 1570867800000

The X axis. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

Y Float 0

The Y axis, which represents the TPS or the total number of consumed messages.

Title String MQ_INST_111111111111_DOxxxxxx%test@MQ_INST_111111111111_DOxxxxxx%GID_test trend chart of total delivered messages

The name of the table.

XUnit String time

The time in the X axis. The time is displayed in the UNIX timestamp format. Unit: milliseconds.

YUnit String msg

The number of consumed messages.

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

The ID of the request, which is a common parameter. Each request has a unique ID to facilitate troubleshooting and fault locating.

Examples

Sample requests

http(s)://ons.cn-hangzhou.aliyuncs.com/? Action=OnsTrendGroupOutputTps
&BeginTime=1570852800000
&EndTime=1570868400000
&GroupId=GID_test
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&Topic=test
&Type=0
&<Common request parameters>

Sample success responses

XML format

<OnsTrendGroupOutputTpsResponse>
  <Data>
        <Records>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570852800000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570853400000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570854000000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570854600000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570855200000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570860600000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570861200000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570861800000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570862400000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570863000000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570863600000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570864200000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>1</Y>
                    <X>1570864800000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570865400000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570866000000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570866600000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570867200000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570867800000</X>
              </StatsDataDo>
              <StatsDataDo>
                    <Y>0</Y>
                    <X>1570868400000</X>
              </StatsDataDo>
        </Records>
        <XUnit>time</XUnit>
        <YUnit>the number of consumed messages</YUnit>
        <Title>MQ_INST_111111111111_DOxxxxxx%test@MQ_INST_111111111111_DOxxxxxx%GID_test trend chart of total delivered messages</Title>
  </Data>
  <RequestId>CE57AEDC-8FD2-43ED-8E3B-1F878077****</RequestId>
</OnsTrendGroupOutputTpsResponse>

JSON format

{
    "Data": {
        "Records": {
            "StatsDataDo": [
                {
                    "Y": 0,
                    "X": 1570852800000
                },
                {
                    "Y": 0,
                    "X": 1570853400000
                },
                {
                    "Y": 0,
                    "X": 1570854000000
                },
                {
                    "Y": 0,
                    "X": 1570854600000
                },
                {
                    "Y": 0,
                    "X": 1570855200000
                },
                {
                    "Y": 0,
                    "X": 1570860600000
                },
                {
                    "Y": 0,
                    "X": 1570861200000
                },
                {
                    "Y": 0,
                    "X": 1570861800000
                },
                {
                    "Y": 0,
                    "X": 1570862400000
                },
                {
                    "Y": 0,
                    "X": 1570863000000
                },
                {
                    "Y": 0,
                    "X": 1570863600000
                },
                {
                    "Y": 0,
                    "X": 1570864200000
                },
                {
                    "Y": 1,
                    "X": 1570864800000
                },
                {
                    "Y": 0,
                    "X": 1570865400000
                },
                {
                    "Y": 0,
                    "X": 1570866000000
                },
                {
                    "Y": 0,
                    "X": 1570866600000
                },
                {
                    "Y": 0,
                    "X": 1570867200000
                },
                {
                    "Y": 0,
                    "X": 1570867800000
                },
                {
                    "Y": 0,
                    "X": 1570868400000
                }
            ]
        },
        "XUnit": "time",
        "YUnit": "the number of consumed messages",
        "Title": "MQ_INST_111111111111_DOxxxxxx%test@MQ_INST_111111111111_DOxxxxxx%GID_test trend chart of total delivered messages"
    },
    "RequestId": "CE57AEDC-8FD2-43ED-8E3B-1F878077****"
}

Error codes

For a list of error codes, visit the API Error Center.

Operations in the console

In addition to calling the OnsTrendGroupOutputTps operation, you can query the statistics on messages consumed by consumers of a specified group ID in the Message Queue for Apache RocketMQ console. For more information, see Resource reports.