diff --git a/vorgang-manager-base/pom.xml b/vorgang-manager-base/pom.xml index 25afbf64ab80f5e7d61e692fd6325352b88eb722..1f00b90766cea2b480f20a66c6421c5e9cd59cc3 100644 --- a/vorgang-manager-base/pom.xml +++ b/vorgang-manager-base/pom.xml @@ -60,6 +60,11 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> + + <dependency> + <groupId>io.micrometer</groupId> + <artifactId>micrometer-core</artifactId> + </dependency> <!-- TEST --> <dependency> diff --git a/vorgang-manager-base/src/main/java/de/ozgcloud/vorgang/VorgangManagerServerApplication.java b/vorgang-manager-base/src/main/java/de/ozgcloud/vorgang/VorgangManagerServerApplication.java index 484b85638b5b232de5232dc3a1f903033f52f434..8f50441266548f322ec607eb1e3950dc15d1d70f 100644 --- a/vorgang-manager-base/src/main/java/de/ozgcloud/vorgang/VorgangManagerServerApplication.java +++ b/vorgang-manager-base/src/main/java/de/ozgcloud/vorgang/VorgangManagerServerApplication.java @@ -42,6 +42,9 @@ import org.springframework.security.authentication.AuthenticationTrustResolver; import org.springframework.security.authentication.AuthenticationTrustResolverImpl; import org.springframework.security.concurrent.DelegatingSecurityContextRunnable; +import io.micrometer.core.aop.TimedAspect; +import io.micrometer.core.instrument.MeterRegistry; + @SpringBootApplication(scanBasePackages = { "de.ozgcloud" }) @EnableAsync(proxyTargetClass = true) @EnableScheduling @@ -83,4 +86,9 @@ public class VorgangManagerServerApplication { return eventMulticaster; } + @Bean + TimedAspect timedAspect(MeterRegistry registry) { + return new TimedAspect(registry); + } + } \ No newline at end of file diff --git a/vorgang-manager-server/src/main/java/de/ozgcloud/vorgang/vorgang/VorgangHeaderService.java b/vorgang-manager-server/src/main/java/de/ozgcloud/vorgang/vorgang/VorgangHeaderService.java index b2d141da322034a3150ae24e67fc53d7daa7cb4d..67364ff253ad7b65537bd73c1b966cdfa389dce0 100644 --- a/vorgang-manager-server/src/main/java/de/ozgcloud/vorgang/vorgang/VorgangHeaderService.java +++ b/vorgang-manager-server/src/main/java/de/ozgcloud/vorgang/vorgang/VorgangHeaderService.java @@ -34,6 +34,7 @@ import org.springframework.stereotype.Service; import de.ozgcloud.common.errorhandling.TechnicalException; import de.ozgcloud.vorgang.common.search.SearchService; +import io.micrometer.core.annotation.Timed; @Service class VorgangHeaderService { @@ -47,6 +48,7 @@ class VorgangHeaderService { @Autowired(required = false) private SearchService searchService; + @Timed("findAllVorgangs") public Page<VorgangHeader> findAll(FindVorgangRequest request) { if (nonNull(searchService) && nonNull(request.getSearchBy())) { return removeUnpermitted(searchService.find(request));