Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.common.UtilAll;
import org.apache.rocketmq.common.stats.Stats;
import org.apache.rocketmq.logging.org.slf4j.Logger;
import org.apache.rocketmq.logging.org.slf4j.LoggerFactory;
import org.apache.rocketmq.remoting.RPCHook;
import org.apache.rocketmq.remoting.exception.RemotingException;
import org.apache.rocketmq.remoting.protocol.admin.ConsumeStats;
Expand All @@ -38,6 +40,8 @@
import org.apache.rocketmq.tools.command.SubCommandException;

public class StatsAllSubCommand implements SubCommand {

private static final Logger log = LoggerFactory.getLogger(StatsAllSubCommand.class);
public static void printTopicDetail(final DefaultMQAdminExt admin, final String topic, final boolean activeTopic)
throws RemotingException, MQClientException, InterruptedException, MQBrokerException {
TopicRouteData topicRouteData = admin.examineTopicRouteInfo(topic);
Expand All @@ -56,6 +60,7 @@ public static void printTopicDetail(final DefaultMQAdminExt admin, final String
inTPS += bsd.getStatsMinute().getTps();
inMsgCntToday += compute24HourSum(bsd);
} catch (Exception e) {
log.debug("Failed to get TOPIC_PUT_NUMS stats for topic={} from broker={}", topic, masterAddr, e);
}
}
}
Expand All @@ -75,6 +80,7 @@ public static void printTopicDetail(final DefaultMQAdminExt admin, final String
outTPS += bsd.getStatsMinute().getTps();
outMsgCntToday += compute24HourSum(bsd);
} catch (Exception e) {
log.debug("Failed to get GROUP_GET_NUMS stats for topic={}, group={} from broker={}", topic, group, masterAddr, e);
}
}
}
Expand All @@ -89,6 +95,7 @@ public static void printTopicDetail(final DefaultMQAdminExt admin, final String
}
}
} catch (Exception e) {
log.debug("Failed to examine consume stats for group={}, topic={}", group, topic, e);
}

if (!activeTopic || inMsgCntToday > 0 ||
Expand Down Expand Up @@ -196,6 +203,7 @@ public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) t
try {
printTopicDetail(defaultMQAdminExt, topic, activeTopic);
} catch (Exception e) {
log.debug("Failed to print topic detail for topic={}", topic, e);
}
}
} catch (Exception e) {
Expand Down
Loading