backend-tech-forge / benchmark

A enterprise level performance testing solution. Taking inspiration from nGrinder, this project aims to develop a Spring Boot application mirroring nGrinder's functionality as closely as feasible.
MIT License
4 stars 0 forks source link

testExecution ---`LAZY LOADING`---> testResult 필수! #83

Closed ghkdqhrbals closed 5 months ago

ghkdqhrbals commented 5 months ago

현재 testTemplate <--EAGER--> testExecution <--?--> testResult <--EAGER--> testTps, testMTTFB, test... 이렇게 되어있습니다.

조금있다가 ERD 수정하겠습니다.

여기서 testExecution 랑 testResult 사이에 EAGER 붙여버리면 그 뒤에 큰 용량인 TPS 와 MTTFB 와 같은 테이블 전부 EAGER 로 자동으로 불러버립니다. 즉, 쿼리 비용이 증가하게 되죠... 단순히 테스트 실행 기록들을 보기위해서는 매번 약 10,000 건의 row 를 불러올거에요. (테스트가 쌓일수록 더 높은 비용 발생)

따라서 testExecution 은 LAZY 로딩으로 testResult 를 불러오도록 구현하였습니다.

이 부분에서 N+1, Lazy Initializing 을 조심하세요! (즉 testExecution 에서 testResult 엑세스 조심!)