File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
api/src/main/java/ca/bc/gov/educ/api/studentgraduation/service Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 7
7
import ca .bc .gov .educ .api .studentgraduation .repository .StudentUndoCompletionReasonRepository ;
8
8
import ca .bc .gov .educ .api .studentgraduation .repository .UndoCompletionReasonRepository ;
9
9
import ca .bc .gov .educ .api .studentgraduation .util .GradValidation ;
10
+ import lombok .extern .log4j .Log4j2 ;
10
11
import org .apache .commons .lang3 .StringUtils ;
11
12
import org .springframework .beans .BeanUtils ;
12
13
import org .springframework .beans .factory .annotation .Autowired ;
20
21
import java .util .Optional ;
21
22
22
23
@ Service
24
+ @ Log4j2
23
25
public class UndoCompletionReasonService {
24
26
25
27
@ Autowired
@@ -46,7 +48,14 @@ public class UndoCompletionReasonService {
46
48
47
49
@ Transactional
48
50
public List <UndoCompletionReason > getAllUndoCompletionReasonCodeList () {
49
- return undoCompletionReasonTransformer .transformToDTO (undoCompletionReasonRepository .findAll ());
51
+ long start1 = System .nanoTime ();
52
+ List <UndoCompletionReasonEntity > undoCompletionReasonEntities = undoCompletionReasonRepository .findAll ();
53
+ long end1 = System .nanoTime ();
54
+ long totalTime = (end1 -start1 )/1000000 ;
55
+ if (totalTime > 500 ){
56
+ log .debug ("Database: undoCompletionReasonRepository.findAll() took longer than 500ms: " + totalTime );
57
+ }
58
+ return undoCompletionReasonTransformer .transformToDTO (undoCompletionReasonEntities );
50
59
}
51
60
52
61
@ Transactional
You can’t perform that action at this time.
0 commit comments