public int getInstanceNum() {

        return instanceMap.size();
    }
add instance to memory, if there is a record refer to the instance id exist we need to destroy it first.
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/instance/InstanceManager.java