private boolean switchWritingStatsUnit(boolean needReset) {
        long lstResetTime = lstSnapshotTime.get();
        long checkDltTime = System.currentTimeMillis() - lstResetTime;
        if (((needReset && (checkDltTime > TBaseConstants.CFG_STATS_MIN_SNAPSHOT_PERIOD_MS))
                || (checkDltTime > this.statsConfig.getForcedResetPeriodMs()))
                && lstSnapshotTime.compareAndSet(lstResetTime, System.currentTimeMillis())) {
            switchableSets[getIndex(writableIndex.incrementAndGet())].resetStartTime();
            return true;
        }
        return false;
    }
Self print statistics information to log file

@param forcePrint    whether force print statistics information
@param needReset     whether reset statistics set
@param strBuff       string buffer
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/common/ClientStatsInfo.java