Skip to content

Commit

Permalink
[ISSUE#8142] Show time of create topic and subScriptionGroup (#8143)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
superdev42 and wengxiaolong authored May 20, 2024
1 parent 9bdc9db commit 256217f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ public boolean rejectRequest() {

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);
Expand Down Expand Up @@ -514,8 +515,10 @@ private synchronized RemotingCommand updateAndCreateTopic(ChannelHandlerContext
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;
}

Expand Down Expand Up @@ -1450,6 +1453,7 @@ public void onException(Throwable e) {

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 {}",
Expand All @@ -1462,6 +1466,8 @@ private RemotingCommand updateAndCreateSubscriptionGroup(ChannelHandlerContext c

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;
}

Expand Down Expand Up @@ -3154,7 +3160,7 @@ private boolean validateSlave(RemotingCommand response) {
}

private boolean validateBlackListConfigExist(Properties properties) {
for (String blackConfig:configBlackList) {
for (String blackConfig : configBlackList) {
if (properties.containsKey(blackConfig)) {
return true;
}
Expand Down

0 comments on commit 256217f

Please sign in to comment.