This is an automated email from the ASF dual-hosted git repository.

jinrongtong 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 256217fb62 [ISSUE#8142] Show time of create topic and 
subScriptionGroup (#8143)
256217fb62 is described below

commit 256217fb6283f8b4c535045682aaef6346be2a87
Author: superdev42 <138118491+superde...@users.noreply.github.com>
AuthorDate: Mon May 20 09:57:21 2024 +0800

    [ISSUE#8142] Show time of create topic and subScriptionGroup (#8143)
    
    * show time of create topic and subScriptionGroup
    
    * show time of create topic and subScriptionGroup again
    
    * show time of create topic and subScriptionGroup changed
    
    ---------
    
    Co-authored-by: wengxiaolong <22260...@zju.edu.cn>
---
 .../apache/rocketmq/broker/processor/AdminBrokerProcessor.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java
 
b/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java
index 78a5ba92ee..a1a6f5bf6c 100644
--- 
a/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java
+++ 
b/broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java
@@ -455,6 +455,7 @@ public class AdminBrokerProcessor implements 
NettyRequestProcessor {
 
     private synchronized RemotingCommand 
updateAndCreateTopic(ChannelHandlerContext ctx,
         RemotingCommand request) throws RemotingCommandException {
+        long startTime = System.currentTimeMillis();
         final RemotingCommand response = 
RemotingCommand.createResponseCommand(null);
         final CreateTopicRequestHeader requestHeader =
             (CreateTopicRequestHeader) 
request.decodeCommandCustomHeader(CreateTopicRequestHeader.class);
@@ -514,8 +515,10 @@ public class AdminBrokerProcessor implements 
NettyRequestProcessor {
             LOGGER.error("Update / create topic failed for [{}]", request, e);
             response.setCode(ResponseCode.SYSTEM_ERROR);
             response.setRemark(e.getMessage());
+            return response;
         }
-
+        long executionTime = System.currentTimeMillis() - startTime;
+        LOGGER.info("executionTime of create topic:{} is {} ms" , topic, 
executionTime);
         return response;
     }
 
@@ -1450,6 +1453,7 @@ public class AdminBrokerProcessor implements 
NettyRequestProcessor {
 
     private RemotingCommand 
updateAndCreateSubscriptionGroup(ChannelHandlerContext ctx, RemotingCommand 
request)
         throws RemotingCommandException {
+        long startTime = System.currentTimeMillis();
         final RemotingCommand response = 
RemotingCommand.createResponseCommand(null);
 
         LOGGER.info("AdminBrokerProcessor#updateAndCreateSubscriptionGroup 
called by {}",
@@ -1462,6 +1466,8 @@ public class AdminBrokerProcessor implements 
NettyRequestProcessor {
 
         response.setCode(ResponseCode.SUCCESS);
         response.setRemark(null);
+        long executionTime = System.currentTimeMillis() - startTime;
+        LOGGER.info("executionTime of create subscriptionGroup:{} is {} ms" 
,config.getGroupName() ,executionTime);
         return response;
     }
 
@@ -3154,7 +3160,7 @@ public class AdminBrokerProcessor implements 
NettyRequestProcessor {
     }
 
     private boolean validateBlackListConfigExist(Properties properties) {
-        for (String blackConfig:configBlackList) {
+        for (String blackConfig : configBlackList) {
             if (properties.containsKey(blackConfig)) {
                 return true;
             }

Reply via email to