Spring Boot / Part 8YOUTUBE PLAYER LOADS ON PLAYTime any method with AOP
@Around
Spring Boot AOP: Log Method Execution Time with @Around & a Custom Annotation
In this lesson
Adding start/end timers to every method just to see how long it takes? With Spring AOP you write that logic once and apply it to any method with a single custom annotation: @LogExecutionTime.
- Creating a custom @LogExecutionTime annotation
- What @Target(ElementType.METHOD) and @Retention(RUNTIME) actually do
- Building an Aspect with @Aspect + @Component
- Using @Around advice to intercept annotated methods
- Measuring and logging execution time around joinPoint.proceed()
- The #1 mistake: forgetting proceed() stops your method from running!
Chapters
Spring Boot, 11 out
1Spring Boot Profiles Explained: Dev, Test and Prod Without Changing Code3:522Lombok in Spring Boot: Stop Writing Getters and Setters (@Data, @Builder, @Slf4j)7:053Spring Boot | Exception Handling & Request Validation | CRUD Operations | RestControllerAdvice27:344Spring Boot | REST API Request Validation & Exception Handling12:435Spring Boot | Controller Unit Testing | Mockito | MockMVC16:396Spring Boot | CRUD Operations with Firebase Firestore | NoSQL Database19:317Spring Boot + Firebase Firestore CRUD: Full REST API Tutorial14:218Spring Boot AOP: Log Method Execution Time with @Around & a Custom Annotation6:389Controller Unit Testing | MockMVC1:0010Exception Handling | Springboot1:0011Spring Boot | REST API Request Validation & Exception Handling0:5012Controller tests with @WebMvcTest and MockMvcWed 6 JanKeep going
More walkthroughs.
3 Spring Boot Testing Mistakes: The Test Passes but the Price Is Wrong, Video.
Spring Boot Testcontainers Tutorial: Test the Whole App on Real Postgres, Video.
Spring Boot @DataJpaTest Tutorial: Test JPA Queries on a Real Database, Video.
Spring Boot 4 Controller Test: @WebMvcTest and MockMvc Tutorial, Video.
