@Override
	public void update(Map<AgentIdentity, AgentProcessControlImplementation.AgentStatus> agentMap) {
		boolean approved = config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_ENABLE_AGENT_AUTO_APPROVAL);
		Set<AgentInfo> agentInfoSet = agentInfoStore.getAllAgentInfo()
			.stream()
			.filter(agentInfo -> StringUtils.equals(agentInfo.getRegion(), config.getRegion()))
			.collect(toSet());

		for (AgentProcessControlImplementation.AgentStatus agentStatus : agentMap.values()) {
			AgentControllerIdentityImplementation agentIdentity = (AgentControllerIdentityImplementation) agentStatus.getAgentIdentity();
			AgentInfo agentInfo = agentInfoStore.getAgentInfo(createKey(requireNonNull(agentIdentity)));
			// check new agent
			if (agentInfo == null) {
				agentInfo = new AgentInfo();
			}

			fillUpAgentInfo(agentInfo, agentStatus);

			AgentInfo agentInfoInDB = agentManagerRepository.findByIpAndName(agentInfo.getIp(), agentInfo.getName());
			if (agentInfoInDB != null) {
				agentInfo.setApproved(agentInfoInDB.getApproved());
			} else {
				agentInfo.setApproved(approved);
			}

			agentInfoStore.updateAgentInfo(agentInfo.getAgentKey(), agentInfo);
			agentInfoSet.remove(agentInfo);
		}

		// delete disconnected agent.
		for (AgentInfo agentInfo : agentInfoSet) {
			agentInfoStore.deleteAgentInfo(agentInfo.getAgentKey());
		}
	}
${@link List} of ready status agents information return

@param userId          the login user id
@param targetRegion    the name of target region
@param targetSubregion the name of target subregion

@return ${@link List} of ready status agents information
ngrinder-controller/src/main/java/org/ngrinder/agent/service/AgentService.java