private static void getStatsValue(ServiceStatsSet statsSet,
            boolean resetValue,
            StringBuilder strBuff) {
        strBuff.append("{\"").append(statsSet.lstResetTime.getFullName())
                .append("\":\"").append(statsSet.lstResetTime.getStrSinceTime())
                .append("\"");
        if (resetValue) {
            // for consume group
            strBuff.append(",\"").append(csmOnlineGroupCnt.getFullName())
                    .append("\":").append(csmOnlineGroupCnt.getAndResetValue())
                    .append(",\"").append(statsSet.csmGroupTimeoutCnt.getFullName())
                    .append("\":").append(statsSet.csmGroupTimeoutCnt.getAndResetValue())
                    .append(",\"").append(csmCltBalanceGroupCnt.getFullName())
                    .append("\":").append(csmCltBalanceGroupCnt.getAndResetValue())
                    .append(",\"").append(statsSet.cltBalGroupTmototCnt.getFullName())
                    .append("\":").append(statsSet.cltBalGroupTmototCnt.getAndResetValue())
                    .append(",");
            statsSet.svrNormalBalanceStats.snapShort(strBuff, false);
            strBuff.append(",");
            statsSet.svrResetBalanceStats.snapShort(strBuff, false);
            // for consumer
            strBuff.append(",\"").append(consumerOnlineCnt.getFullName())
                    .append("\":").append(consumerOnlineCnt.getAndResetValue())
                    .append(",\"").append(statsSet.consumerTmoTotCnt.getFullName())
                    .append("\":").append(statsSet.consumerTmoTotCnt.getAndResetValue())
                    .append(",\"").append(consumerInConnectCount.getFullName())
                    .append("\":").append(consumerInConnectCount.getAndResetValue())
                    .append(",\"").append(consumerInDisConnectCount.getFullName())
                    .append("\":").append(consumerInDisConnectCount.getAndResetValue())
                    // for producer
                    .append(",\"").append(producerOnlineCnt.getFullName())
                    .append("\":").append(producerOnlineCnt.getAndResetValue())
                    .append(",\"").append(statsSet.producerTmoTotCnt.getFullName())
                    .append("\":").append(statsSet.producerTmoTotCnt.getAndResetValue())
                    // for broker
                    .append(",\"").append(brokerConfiguredCnt.getFullName())
                    .append("\":").append(brokerConfiguredCnt.getAndResetValue())
                    .append(",\"").append(brokerOnlineCnt.getFullName())
                    .append("\":").append(brokerOnlineCnt.getAndResetValue())
                    .append(",\"").append(statsSet.brokerTmoTotCnt.getFullName())
                    .append("\":").append(statsSet.brokerTmoTotCnt.getAndResetValue())
                    .append(",\"").append(brokerAbnCurCnt.getFullName())
                    .append("\":").append(brokerAbnCurCnt.getAndResetValue())
                    .append(",\"").append(brokerFbdCurCnt.getFullName())
                    .append("\":").append(brokerFbdCurCnt.getAndResetValue())
                    .append("}");
        } else {
            // for consume group
            strBuff.append(",\"").append(csmOnlineGroupCnt.getFullName())
                    .append("\":").append(csmOnlineGroupCnt.getValue())
                    .append(",\"").append(statsSet.csmGroupTimeoutCnt.getFullName())
                    .append("\":").append(statsSet.csmGroupTimeoutCnt.getValue())
                    .append(",\"").append(csmCltBalanceGroupCnt.getFullName())
                    .append("\":").append(csmCltBalanceGroupCnt.getValue())
                    .append(",\"").append(statsSet.cltBalGroupTmototCnt.getFullName())
                    .append("\":").append(statsSet.cltBalGroupTmototCnt.getValue())
                    .append(",");
            statsSet.svrNormalBalanceStats.getValue(strBuff, false);
            strBuff.append(",");
            statsSet.svrResetBalanceStats.getValue(strBuff, false);
            // for consumer
            strBuff.append(",\"").append(consumerOnlineCnt.getFullName())
                    .append("\":").append(consumerOnlineCnt.getValue())
                    .append(",\"").append(statsSet.consumerTmoTotCnt.getFullName())
                    .append("\":").append(statsSet.consumerTmoTotCnt.getValue())
                    .append(",\"").append(consumerInConnectCount.getFullName())
                    .append("\":").append(consumerInConnectCount.getValue())
                    .append(",\"").append(consumerInDisConnectCount.getFullName())
                    .append("\":").append(consumerInDisConnectCount.getValue())
                    // for producer
                    .append(",\"").append(producerOnlineCnt.getFullName())
                    .append("\":").append(producerOnlineCnt.getValue())
                    .append(",\"").append(statsSet.producerTmoTotCnt.getFullName())
                    .append("\":").append(statsSet.producerTmoTotCnt.getValue())
                    // for broker
                    .append(",\"").append(brokerConfiguredCnt.getFullName())
                    .append("\":").append(brokerConfiguredCnt.getValue())
                    .append(",\"").append(brokerOnlineCnt.getFullName())
                    .append("\":").append(brokerOnlineCnt.getValue())
                    .append(",\"").append(statsSet.brokerTmoTotCnt.getFullName())
                    .append("\":").append(statsSet.brokerTmoTotCnt.getValue())
                    .append(",\"").append(brokerAbnCurCnt.getFullName())
                    .append("\":").append(brokerAbnCurCnt.getValue())
                    .append(",\"").append(brokerFbdCurCnt.getFullName())
                    .append("\":").append(brokerFbdCurCnt.getValue())
                    .append("}");
        }
    }
MasterSrvStatsHolder, statistics Master's RPC service metric information

This class counts the number of consumer groups, timeouts, the load balancing duration
distribution of consumer groups, as well as the total number of registered consumers
in the system, the number of timeouts, the number of tasks being processed,
the total number of producers, the total number of timeouts,
and Broker registration and timeouts, etc.
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/stats/MasterSrvStatsHolder.java