private boolean sendAgentInfo() {
            AgentInfo agentInfo = null;
            try {
                agentInfo = agentInfoFactory.createAgentInfo();

                logger.info("Sending AgentInfo={}", agentInfo);
                CompletableFuture<ResultResponse> future = dataSender.request(agentInfo);
                ResultResponse result = future.get(3000, TimeUnit.MILLISECONDS);
                if (result == null) {
                    if (agentInfo != null && agentInfo.getAgentInformation() != null) {
                        logger.warn("Failed to send agentInfo={}. result not set", agentInfo.getAgentInformation());
                    } else {
                        logger.warn("Failed to send agentInfo. result not set");
                    }
                    return false;
                }
                if (!result.isSuccess()) {
                    if (agentInfo != null && agentInfo.getAgentInformation() != null) {
                        logger.warn("Failed to send agentInfo={}. request unsuccessful, response={}", agentInfo.getAgentInformation(), result.getMessage());
                    } else {
                        logger.warn("Failed to send agentInfo. request unsuccessful, response={}", result.getMessage());
                    }
                }
                return result.isSuccess();
            } catch (ExecutionException ex) {
                logError(agentInfo, ex.getCause());
            } catch (InterruptedException ex) {
                Thread.currentThread().interrupt();
                logError(agentInfo, ex);
            } catch (TimeoutException ex) {
                logError(agentInfo, ex);
            }
            return false;
        }
@author emeroad
@author koo.taejin
@author HyunGil Jeong
agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/AgentInfoSender.java