Skip to content
Snippets Groups Projects
Commit a365d212 authored by Tobias Bruns's avatar Tobias Bruns
Browse files

add timing metric for loading vorgangs

parent 8de88cf6
No related branches found
No related tags found
1 merge request!28List performance check
...@@ -61,6 +61,11 @@ ...@@ -61,6 +61,11 @@
<artifactId>spring-boot-starter-validation</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
<!-- TEST --> <!-- TEST -->
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
......
...@@ -42,6 +42,9 @@ import org.springframework.security.authentication.AuthenticationTrustResolver; ...@@ -42,6 +42,9 @@ import org.springframework.security.authentication.AuthenticationTrustResolver;
import org.springframework.security.authentication.AuthenticationTrustResolverImpl; import org.springframework.security.authentication.AuthenticationTrustResolverImpl;
import org.springframework.security.concurrent.DelegatingSecurityContextRunnable; import org.springframework.security.concurrent.DelegatingSecurityContextRunnable;
import io.micrometer.core.aop.TimedAspect;
import io.micrometer.core.instrument.MeterRegistry;
@SpringBootApplication(scanBasePackages = { "de.ozgcloud" }) @SpringBootApplication(scanBasePackages = { "de.ozgcloud" })
@EnableAsync(proxyTargetClass = true) @EnableAsync(proxyTargetClass = true)
@EnableScheduling @EnableScheduling
...@@ -83,4 +86,9 @@ public class VorgangManagerServerApplication { ...@@ -83,4 +86,9 @@ public class VorgangManagerServerApplication {
return eventMulticaster; return eventMulticaster;
} }
@Bean
TimedAspect timedAspect(MeterRegistry registry) {
return new TimedAspect(registry);
}
} }
\ No newline at end of file
...@@ -34,6 +34,7 @@ import org.springframework.stereotype.Service; ...@@ -34,6 +34,7 @@ import org.springframework.stereotype.Service;
import de.ozgcloud.common.errorhandling.TechnicalException; import de.ozgcloud.common.errorhandling.TechnicalException;
import de.ozgcloud.vorgang.common.search.SearchService; import de.ozgcloud.vorgang.common.search.SearchService;
import io.micrometer.core.annotation.Timed;
@Service @Service
class VorgangHeaderService { class VorgangHeaderService {
...@@ -47,6 +48,7 @@ class VorgangHeaderService { ...@@ -47,6 +48,7 @@ class VorgangHeaderService {
@Autowired(required = false) @Autowired(required = false)
private SearchService searchService; private SearchService searchService;
@Timed("findAllVorgangs")
public Page<VorgangHeader> findAll(FindVorgangRequest request) { public Page<VorgangHeader> findAll(FindVorgangRequest request) {
if (nonNull(searchService) && nonNull(request.getSearchBy())) { if (nonNull(searchService) && nonNull(request.getSearchBy())) {
return removeUnpermitted(searchService.find(request)); return removeUnpermitted(searchService.find(request));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment