public static void refreshModuleConnectionCount(Map<String, Integer> connectionCnt) {
        // refresh all existed module connection cnt and add new module connection count
        connectionCnt.forEach((module, cnt) -> {
            AtomicInteger integer = moduleConnectionCnt.get(module);
            // if exists
            if (integer != null) {
                integer.set(cnt);
            } else {
                // new module comes
                AtomicInteger newModuleConnCnt = new AtomicInteger(cnt);
                moduleConnectionCnt.put(module, newModuleConnCnt);
                NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor",
                        Arrays.asList(
                                new ImmutableTag("module", module),
                                new ImmutableTag("name", "longConnection")
                        ),
                        moduleConnectionCnt.get(module));
            }
        });
        // reset the outdated module connection cnt
        moduleConnectionCnt.forEach((module, cnt) -> {
            if (connectionCnt.containsKey(module)) {
                return;
            }
            cnt.set(0);
        });
    }
@Test
    void testRefreshModuleConnectionCount() {
        // refresh
        Map<String, Integer> map = new HashMap<>();
        map.put("naming", 10);
        MetricsMonitor.refreshModuleConnectionCount(map);
        assertEquals(1, MetricsMonitor.getModuleConnectionCnt().size());
        assertEquals(10, MetricsMonitor.getModuleConnectionCnt().get("naming").get());
        
        // refresh again
        map = new HashMap<>();
        map.put("naming", 11);
        map.put("config", 1);
        MetricsMonitor.refreshModuleConnectionCount(map);
        assertEquals(2, MetricsMonitor.getModuleConnectionCnt().size());
        assertEquals(11, MetricsMonitor.getModuleConnectionCnt().get("naming").get());
        assertEquals(1, MetricsMonitor.getModuleConnectionCnt().get("config").get());
        
        // refresh again
        map = new HashMap<>();
        map.put("naming", 1);
        MetricsMonitor.refreshModuleConnectionCount(map);
        assertEquals(2, MetricsMonitor.getModuleConnectionCnt().size());
        assertEquals(1, MetricsMonitor.getModuleConnectionCnt().get("naming").get());
        assertEquals(0, MetricsMonitor.getModuleConnectionCnt().get("config").get());
    }