public void addAndGet(String key, int cnt, int packcnt, long packsize, int failcnt) {
        try {
            if (counterMap.size() < maxCnt) {
                counterMap.compute(key, (key1, value) -> {
                    if (value != null) {
                        String[] va = value.split("#");
                        value = (Integer.parseInt(va[0]) + cnt) + "#"
                                + (Integer.parseInt(va[1]) + packcnt) + "#"
                                + (Long.parseLong(va[2]) + packsize) + "#"
                                + (Integer.parseInt(va[3]) + failcnt);
                    } else {
                        StringBuilder stringBuilder = new StringBuilder();
                        value = stringBuilder.append(cnt).append("#").append(packcnt).append("#")
                                .append(packsize).append("#").append(failcnt).toString();
                    }
                    return value;
                });
            } else if (logPrinter.shouldPrint()) {
                logger.error(this.name + "exceed monitor's max size");
            }
        } catch (Exception e) {
            if (logPrinter.shouldPrint()) {
                logger.error("monitor exception", e);
            }
        }
    }
addAndGet
@param key
@param cnt
@param packcnt
@param packsize
@param failcnt
inlong-common/src/main/java/org/apache/inlong/common/monitor/MonitorIndex.java