Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Dynamic agent registeration & multiple stomp topic & scheduler feature #60

Merged
merged 96 commits into from
Mar 30, 2024

Conversation

ghkdqhrbals
Copy link
Member

@ghkdqhrbals ghkdqhrbals commented Mar 28, 2024

Implement

  • Netflix EUREKA for discovering bm-agents
  • Pagination applied in controller
  • Dynamic Server Registeration (bm-agent can be registered by connecting EUREKA server with given application name : bm-agent )
    1. bm-agent register their url through EUREKA
    2. bm-controller is now searching bm-agent from EUREKA
    3. bm-controller update agent information by sending HTTP request to each of bm-agent (every seconds)
    4. bm-agent send back their status, info(cpu&memory usage) to bm-controller
    5. bm-controller's performance tester read saved agent status, and if it's ready, send ?action=start to specific agent
    6. Concurrently, bm-controller update agent status and push to client using stomp web socket

Here's changed agent status
image image

  • bm-agent status is changing in real-time between TESTING, READY
  • docker-compose file added
  • Spring actuator health check

spring cloud 의 eureka 가 추가되었습니다! 여러 bm-agent 를 eureka 에 등록하고 bm-controller 가 이를 읽고 bm-agent 의 실 주소를 확인할 수 있습니다.

Developer log

@LeeJeongGi

  1. ./gradlew build 후 docker compose up 하시면 eureka, bm-controller, bm-agent 1 2 가 자동으로 실행됩니다 :)

  2. 만약 Intellij 에서 실행하고 싶으시다면, eureka 실행 -> controller, bm-agent 실행 하시면 됩니다.

image

여러 agent 실행 시, 아래와 같이 port 를 변경하여 실행하시면 됩니다.
image

@ghkdqhrbals ghkdqhrbals self-assigned this Mar 28, 2024
@backend-tech-forge backend-tech-forge deleted a comment from github-actions bot Mar 28, 2024
@LeeJeongGi
Copy link
Member

오늘도 잠을 안자시고 해주셨군요,,

@ghkdqhrbals
Copy link
Member Author

헙 시간이 벌써!

@backend-tech-forge backend-tech-forge deleted a comment from github-actions bot Mar 28, 2024
@LeeJeongGi
Copy link
Member

저도 요번 주말엔 열심히 달립니다! :)

@backend-tech-forge backend-tech-forge deleted a comment from github-actions bot Mar 29, 2024
@ghkdqhrbals ghkdqhrbals changed the title Feature/template info builder feat: Dynamic agent registeration & multiple stomp topic & scheduler feature Mar 29, 2024
Copy link
Member

@LeeJeongGi LeeJeongGi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요번 코드를 보면서 느낀건 service 로직에 있는 method 명을 직관적으로 잘 지으신거 같아요.

내부 로직은 어떤지 모르지만 method만 보고 대충 어떤 작업을 하겠구나 느낌이 잘와서 좋았습니다!!
저도 method 명 지을 때 참고좀 해야 겠네요.

수고 많으셨습니다!! :) (정말 많이 배우고 있습니다.ㅎㅎ)

HttpSender htps = httpSender.get(id);

LocalDateTime now = LocalDateTime.now();
List<Double> percentiles = PreftestConsts.percentiles;

// 1초마다 TestResult 를 보내는 스케줄러 시작
scheduledTaskService.start(id, () -> {
LocalDateTime cur = LocalDateTime.now();
LocalDateTime c = LocalDateTime.now();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변수명을 c로 지으신 이유가 있을까요?!

어떤 의미가 있는지 쉽게 판단이 안됩니당!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 급하게 하다보니 잘못 적었네요ㅜㅜ 바로 수정하겠습니다!

@backend-tech-forge backend-tech-forge deleted a comment from github-actions bot Mar 30, 2024
@ghkdqhrbals ghkdqhrbals merged commit d92817b into develop Mar 30, 2024
1 check passed
@ghkdqhrbals ghkdqhrbals deleted the feature/template-info-builder branch March 30, 2024 08:17
Copy link

📝 Test code-coverage reports

File Coverage [49.19%]
SystemSchedulerConst.java 100% 🍏
AbstractScheduledTaskService.java 100% 🍏
ISseManageService.java 100% 🍏
BMUserDetailsService.java 100% 🍏
JwtTokenProvider.java 100% 🍏
AgentApiController.java 88.89% 🍏
Initializer.java 84.62% 🍏
PerftestController.java 75.14% 🍏
JwtAuthFilter.java 72.53% 🍏
DataLoader.java 65.04% 🍏
HttpSender.java 62.5% 🍏
GlobalRestControllerAdvice.java 58.82%
BmAgentApplication.java 56%
PerftestService.java 47.57%
SseManageService.java 47.06%
AgentStatusManager.java 39.68%
BmControllerApplication.java 25%
GroupController.java 3.88%
UserController.java 3.1%
ScheduledTaskService.java 0%
AgentServerManager.java 0%
AgentListener.java 0%
Total Project Coverage 71.17% 🍏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
2 participants