Skip to content

Commit

Permalink
Merge pull request #41 from final-idea-rush/develop
Browse files Browse the repository at this point in the history
입찰 시간 측정하는 코드 적용
  • Loading branch information
ironprayer committed Aug 25, 2023
2 parents 5860d42 + 5eb794e commit 0e90b77
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ public class BidService {
private final BidRepository bidRepository;
private final NoticeService noticeService;
private final SseService sseService;
private static long end_time= 0L;

@Transactional
public void createBid(Long ideaId, Long userId, BidRequest request) {
long point_one = System.currentTimeMillis();
long start_method_time = point_one;
Idea idea = ideaRepository.findByIdWithPessimisticLock(ideaId).orElseThrow(() ->
new IdeaFindException(IdeaFindErrorCode.IDEA_EMPTY));
long point_two = System.currentTimeMillis();
Expand All @@ -54,8 +56,12 @@ public void createBid(Long ideaId, Long userId, BidRequest request) {
noticeService.noticeBidEvent(userId, idea, request.bidPrice());
long point_seven = System.currentTimeMillis();

point_one = end_time == 0L ? point_one : end_time;
end_time = point_seven;

log.info( "Idea Id : " + ideaId
+ " Bid Id : " + newBid.getId()
+ " Deley Time : " + (point_one - start_method_time)
+ " Start Time :" + point_one
+ " All Time : " + (point_seven - point_one)
+ " Idea Find Time : " + (point_two - point_one)
Expand Down

0 comments on commit 0e90b77

Please sign in to comment.