This is an automated email from the ASF dual-hosted git repository. ltamber pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push: new 4e8a5ca48f Add incGroupAckNums and incGroupCkNums to LmqBrokerStatsManager (#8943) 4e8a5ca48f is described below commit 4e8a5ca48f5d37d8063beb0b79608fd43a942132 Author: rongtong <jinrongton...@mails.ucas.ac.cn> AuthorDate: Mon Nov 18 14:23:00 2024 +0800 Add incGroupAckNums and incGroupCkNums to LmqBrokerStatsManager (#8943) --- .../apache/rocketmq/broker/BrokerController.java | 6 ++++- .../store/stats/LmqBrokerStatsManager.java | 27 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java index ee211e1b80..b6c903929d 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java @@ -237,7 +237,7 @@ public class BrokerController { protected final BlockingQueue<Runnable> endTransactionThreadPoolQueue; protected final BlockingQueue<Runnable> adminBrokerThreadPoolQueue; protected final BlockingQueue<Runnable> loadBalanceThreadPoolQueue; - protected final BrokerStatsManager brokerStatsManager; + protected BrokerStatsManager brokerStatsManager; protected final List<SendMessageHook> sendMessageHookList = new ArrayList<>(); protected final List<ConsumeMessageHook> consumeMessageHookList = new ArrayList<>(); protected MessageStore messageStore; @@ -2305,6 +2305,10 @@ public class BrokerController { return brokerStatsManager; } + public void setBrokerStatsManager(BrokerStatsManager brokerStatsManager) { + this.brokerStatsManager = brokerStatsManager; + } + public List<SendMessageHook> getSendMessageHookList() { return sendMessageHookList; } diff --git a/store/src/main/java/org/apache/rocketmq/store/stats/LmqBrokerStatsManager.java b/store/src/main/java/org/apache/rocketmq/store/stats/LmqBrokerStatsManager.java index f0e23fe638..b17fcbc9ca 100644 --- a/store/src/main/java/org/apache/rocketmq/store/stats/LmqBrokerStatsManager.java +++ b/store/src/main/java/org/apache/rocketmq/store/stats/LmqBrokerStatsManager.java @@ -50,6 +50,33 @@ public class LmqBrokerStatsManager extends BrokerStatsManager { super.incGroupGetSize(lmqGroup, lmqTopic, incValue); } + + @Override + public void incGroupAckNums(final String group, final String topic, final int incValue) { + String lmqGroup = group; + String lmqTopic = topic; + if (MixAll.isLmq(group)) { + lmqGroup = MixAll.LMQ_PREFIX; + } + if (MixAll.isLmq(topic)) { + lmqTopic = MixAll.LMQ_PREFIX; + } + super.incGroupAckNums(lmqGroup, lmqTopic, incValue); + } + + @Override + public void incGroupCkNums(final String group, final String topic, final int incValue) { + String lmqGroup = group; + String lmqTopic = topic; + if (MixAll.isLmq(group)) { + lmqGroup = MixAll.LMQ_PREFIX; + } + if (MixAll.isLmq(topic)) { + lmqTopic = MixAll.LMQ_PREFIX; + } + super.incGroupCkNums(lmqGroup, lmqTopic, incValue); + } + @Override public void incGroupGetLatency(final String group, final String topic, final int queueId, final int incValue) { String lmqGroup = group;