You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
문제 발견
NGrinder 로 API 성능 테스트를 진행했습니다.
가상 사용자를 200명으로 설정하고, 3분 간 점진적으로 위치정보 저장 API를 요청하도록 설정했습니다.
TPS는 9.7로 매우 낮은 수치를 기록했습니다.
동일한 설정으로 여행 저장, 여행 전체 조회 등의 API에도 실험을 진행했습니다.
위치정보 저장과는 달리 각각 251, 126으로 100 이상을 상회했습니다.
위치정보 저장 API에 문제가 있다는 사실을 깨달았습니다.
분석
단일 요청
우선 위치정보 저장에 대한 단일 API 요청의 실행 시간을 살펴보았습니다.
로그를 확인해보니, 15ms 를 기록했습니다.
단일 요청에 대해서는 성능이 준수한 것을 확인할 수 있었습니다.
다중 동시 요청
NGrinder 확인
코드 분석
현재 Trip 과 Point는 다대일 양방향 연관관계를 맺고 있습니다.
그리고 두 클래스는 모두 연관관계 편의 메서드를 갖고 있습니다.
하지만 Trip.add () 메서드는 사용하지 않는 메서드가 되어야 합니다. 해당 메서드는 Point의 연관관계를 설정해주지 못하며, Point.setTrip() 메서드와 함께 사용할 경우, Trip에 Point가 중복해서 입력되기 때문입니다.
접근제어자가 public 인 메서드를 개발자들이 합의해서 사용하지 않는 것이 과연 괜찮은 코드인가?에 대한 물음이 남습니다.
Beta Was this translation helpful? Give feedback.
All reactions