private StringBuilder innEnableOrDisableMetricsStats(boolean enable,
            String statsType,
            HttpServletRequest req,
            StringBuilder sBuffer,
            ProcessResult result) {
        // get input metric type
        MasterStatsType inMetricType = null;
        for (MasterStatsType metricType : MasterStatsType.values()) {
            if (metricType.getName().equalsIgnoreCase(statsType)) {
                inMetricType = metricType;
                break;
            }
        }
        if (inMetricType == null) {
            sBuffer.append("{\"result\":false,\"errCode\":400,\"errMsg\":")
                    .append("\"Unmatched stat type, allowed stat type are : [");
            int count = 0;
            for (MasterStatsType metricType : MasterStatsType.values()) {
                if (count++ > 0) {
                    sBuffer.append(",");
                }
                sBuffer.append(metricType.getName());
            }
            sBuffer.append("]\"}");
            return sBuffer;
        }
        // Operate separately according to the specified statistic type
        if (inMetricType == MasterStatsType.WEBAPI
                || inMetricType == MasterStatsType.ALL) {
            WebCallStatsHolder.setStatsStatus(enable);
        }
        // builder return result
        WebParameterUtils.buildSuccessResult(sBuffer);
        return sBuffer;
    }
Disable or Enable Master's statistics functions

@param enable     whether enable or disable
@param statsType  the statistics type to be operated on
@param req        HttpServletRequest
@param sBuffer    query result
@param result     process result
@return           return information
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/web/handler/WebOtherInfoHandler.java