You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "humkum (via GitHub)" <gi...@apache.org> on 2023/08/22 12:18:54 UTC

[GitHub] [rocketmq] humkum commented on a diff in pull request #7161: fix(lmq): fix lmq stats

humkum commented on code in PR #7161:
URL: https://github.com/apache/rocketmq/pull/7161#discussion_r1301557476


##########
store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java:
##########
@@ -774,11 +774,16 @@ private void doDispatchLmqQueue(DispatchRequest request, int maxRetries, String
         int queueId) {
         ConsumeQueueInterface cq = this.messageStore.findConsumeQueue(queueName, queueId);
         boolean canWrite = this.messageStore.getRunningFlags().isCQWriteable();
+        final long beginTimeMillis = this.messageStore.now();
         for (int i = 0; i < maxRetries && canWrite; i++) {
             boolean result = ((ConsumeQueue) cq).putMessagePositionInfo(request.getCommitLogOffset(), request.getMsgSize(),
                 request.getTagsCode(),
                 queueOffset);
             if (result) {
+                this.messageStore.getBrokerStatsManager().incTopicPutNums(queueName, 1, 1);
+                this.messageStore.getBrokerStatsManager().incTopicPutSize(queueName, request.getMsgSize());
+                this.messageStore.getBrokerStatsManager().incBrokerPutNums(queueName, 1);

Review Comment:
   IMO, dispatch lmq just create a consume index, it didn't really put a message to broker, incBrokerPutNums here maybe inappropriate.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org