@Override
        public void run() {
            String uuidStr;
            long currentKey;
            Map<String, String> counterExt = new HashMap<String, String>();
            while (!bShutDown) {
                try {
                    Thread.sleep(intervalSec * 1000L);
                    for (String str : counterMap.keySet()) {
                        counterMap.computeIfPresent(str, (s, s2) -> {
                            counterExt.put(s, s2);
                            return null;
                        });
                    }
                    // get print time (second)
                    currentKey = System.currentTimeMillis() / 1000;
                    for (Map.Entry<String, String> entrys : counterExt.entrySet()) {
                        uuidStr = currentKey + "_" + recId.incrementAndGet();
                        logger.info("{}#{}#{}#{}",
                                new Object[]{name, uuidStr, entrys.getKey(), entrys.getValue()});
                    }
                    counterExt.clear();
                } catch (Exception e) {
                    logger.warn("monitor interrupted");
                }
            }

        }
addAndGet
@param key
@param cnt
@param packcnt
@param packsize
@param failcnt
inlong-common/src/main/java/org/apache/inlong/common/monitor/MonitorIndex.java